|
|
Why do you need the two types?
You could specify your template as:
template <typename container>
class pointer_container
{
};
and check that it really contains pointers (or something dereferenceable) in the constructor:
pointer_container()
{
container::value_type ptr;
*ptr;
};
then:
pointer_container<std::vector<int> > int_container;
pointer_container<std::vector<int *> > int_ptr_container;
Now the sermon:
IF you want to maintain a collection of pointers and delete what they're pointing to when the object dies, how about using the magic of smart pointers instead?
std::vector< std::shared_ptr< my_class> > my_class_v;
or use Thorsten Ottosen's pointer containers from Boost[^].
If you're not, please disregard the second half of this message!
Cheers,
Ash
|
|
|
|
|
Buenas, busco programadores de C++ para un proyecto relativamente pequeño, el cual consiste en desarrollar un Motor para creación de videojuegos, basado en DirectX 10.1 para Windows 7. El framework pretende abarcar las 4 grandes ramas de DirectX: Gráficos (Direct3D), Sonido (DirectSound), Comunicaciones (DirectPlay) y Entrada/Salida de periféricos (DirectInput). Aunque se diseñará en tal sentido, no se contempla su portabilidad, lo cual permite una mayor especialización, mayor velocidad de avance y mejor soporte. El proyecto será Open Source en cuanto alcance cierto grado de madurez que facilite la integración de aportaciones externas.
Se requiere:
- Nivel alto de inglés leído / escrito. La documentación y la nomenclatura de los elementos del framework serán en inglés; además, eventualmente será necesario leer algún libro o documentación en tal idioma.
- Conocimiento "a fondo" de C++.
- Gran capacidad autodidacta. Esto es muy importante, quizá lo más valioso.
- Pasión por la programación, el diseño de sistemas o los videojuegos.
- Seriedad y constancia.
- Alguna experiencia desarrollando con Microsoft Visual Studio (se usará 2010 express... ejem ).
- Alguna experiencia con Subversion (quizá se use Mercurial).
- No se requiere alto control del SDK de DirectX 10.1, puede aprenderse sobre la marcha. Se apreciará experiencia con cualquier versión de DirectX, incluso con cualquier versión de OpenGL.
- Preferible residencia en España, cuanto más próxima a Málaga mejor.
- Capacidad de autocrítica. Vital para la fluidez de equipo de trabajo.
- Tiempo. Aunque cualquiera pueda dejar el proyecto cuando le plazca, no es plato de buen gusto que asegure su disponibilidad sabiendo que no la va a tener.
Se ofrece:
- Dinero no, desde luego. Es un "trabajo" vocacional, aquella persona que prentenda subir al barco debe disfrutar participando, trabajando en equipo, aprendiendo, aportando ideas, viendo crecer el proyecto.
- Todos los puntos que se requieren.
- Aporto gran conocimiento de C++ y sus entresijos (particularidades de diseño, trucos de optimización, etc.).
- Conozco a fondo el SDK de DirectX 9.0c (de ahí que prefiera dar el salto a DX10 y no a DX11 directamente, aunque todo se andará) y tengo a mano una buena biblioteca cuya lectura aconsejar.
- No tengo inconveniente en ayudar a autoformarse a los integrantes del equipo.
- Capacidad de gestión. Tengo ya pensada y a medio montar la plataforma de desarrollo. Aunque en principio actúe como director, más tarde mi rol se disipará hasta quedar como un desarrollador/diseñador más, con la carga adicional de mantener la calidad y cohesión del proyecto.
- Tengo ya trazadas las líneas maestras del proyecto y sus objetivos, se aceptarán opiniones y cambios al respecto.
- Compromiso.
Un saludo, espero formar algún día un equipo capaz de crear una obra cada vez más ambiciosa y de cuyos integrantes aprender tanto como les haya podido enseñar.
Thund.
|
|
|
|
|
This type of advertisement is not appropriate in this area. You should post to the job board instead.
|
|
|
|
|
|
Hi
I have set up a video and connected it to a sample grabber correctly, so that I can see the image, but I cant get sound out, I have tried to render sound, but dont know how to connect it up, any help would be greatly appreciated.
I have attached the following code snippet that shows what I have.
HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph);
hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
hr = pGraph->QueryInterface(IID_IMediaEventEx, (void **)&pEvent);
hr = pGraph->QueryInterface(IID_IBasicAudio, reinterpret_cast<void**>(&m_pAudio));
hr = pGraph->QueryInterface(IID_IMediaSeeking, reinterpret_cast<void**>(&pSeeking));
hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&pGrabberF);
if (FAILED(hr))
{
// Return an error.
}
hr = pGraph->AddFilter(pGrabberF, L"Sample Grabber");
CoCreateInstance(CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pSoundRenderer);
hr = pGraph->AddFilter(g_pSoundRenderer, NULL);
// hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&pGrabberF);
// hr = pGraph->AddFilter(
if (FAILED(hr) )
{
// Return an error.
}
pGrabberF->QueryInterface(IID_ISampleGrabber, (void**)&pGrabber);
//ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
mt.majortype = MEDIATYPE_Stream;
//mt.subtype = GUID_NULL;//MEDIASUBTYPE_RGB24;
hr = pGrabber->SetMediaType(&mt);
hr = pGraph->AddSourceFilter(fileName.AllocSysString(), L"Source", &pSrc);
if (FAILED(hr))
{
// Return an error code.
}
hr = ConnectFilters(pGraph, pSrc, pGrabberF);
// Create the NULL renderer and connect
hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, reinterpret_cast<void**>(&m_pNullRenderer));
hr = pGraph->AddFilter(m_pNullRenderer, L"NullRenderer");
hr = ConnectFilters(pGraph, pGrabberF, m_pNullRenderer);
|
|
|
|
|
I would recommend you to test your graph using Graphedit and the construct it programatically.There is are a lot of reasons that could cause errors in your code.
Life is a stage and we are all actors!
|
|
|
|
|
How do I set up project wide settings. All of my sub-projects need to access the same #include paths. Can I set this up somewhere for solution instead of every project
Same question for pre-processor defines. where do I set up some constants to be used by every project?
ES
|
|
|
|
|
Open Property Manager.
View -> Other Windows -> Property Manager
Expand the project and the configuration.
Right click on Microsoft.Cpp.Win32.user and select Properties .
What ever changes you make here will globally effect that particular configuration.
|
|
|
|
|
my code is below:
g_hIconImageList = ImageList_Create(18, 17, ILC_COLOR16, 7, 10);
hBitMap = LoadBitmap(hInst,MAKEINTRESOURCE(nIconImageID));
ImageList_Add(g_hIconImageList, hBitMap, NULL);
DeleteObject(hBitMap);
TreeView_SetImageList(g_hTreeViewHandle, g_hIconImageList, TVSIL_NORMAL);
......
if(g_hCheckBoxImageList != NULL)
{
ImageList_Destroy(g_hCheckBoxImageList);
g_hCheckBoxImageList = NULL;
}
I detect 4 GDI leaked. Only TVSIL_NORMAL will cause GDI leak not TVSIL_STATE.
I change my code by http://www.codeproject.com/Messages/2125713/Re-GDI-Leak-in-CTreeCtrl-with-TVS_CHECKBOXES-prope.aspx[^], but it does't work.
|
|
|
|
|
Resolve:http://support.microsoft.com/kb/228859
|
|
|
|
|
HI Gurus,
Iam invoking my server from batch file.
Iam trying to run six projects sequentially, But After three projects executed successfully, Windows Exception coming.
Some times for every project Windows Exception coming.
my Batch file is like this.
DUCommandLine.exe -u sa -a sa -p DB2DB1 -s Rayalu -n 10
DUCommandLine.exe -u sa -a sa -p DB2DB2 -s Rayalu -n 10
DUCommandLine.exe -u sa -a sa -p DB2DB3 -s Rayalu -n 10
DUCommandLine.exe -u sa -a sa -p DB2DB4 -s Rayalu -n 10
DUCommandLine.exe -u sa -a sa -p DB2DB5 -s Rayalu -n 10
Individual projects iam able to run successfully.
Can i get return value after execution of each project.
Please guide me to fix this problem.
Thanks,
Krishna
|
|
|
|
|
Test the errorlevel[^] after each command to decide whether to continue. Your application should set this value in its exit() call or the return value from main() . You should also catch any exceptions and print a meaningful message to assist in diagnosing the problem.
It's time for a new signature.
|
|
|
|
|
use for every instance an new console. "CALL ..."
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
HI Gurus,
it is Throwing DOS Error code 1073741819
After finishing third Project.
If i run 5 projects in 5 batch files then Individually all projects running successfully.
Thanks
Krishna
|
|
|
|
|
do you know that you can enter "help" in a dos window.
The right command ist "START ..."
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
I have picture control in dailog.Im loading image in OnPaint() for that picture control.And i have If else condition,depends on i will change the bitmap.
But what happened is when i invoke Dialog,immediately i can see image like a blink.thatsall .then it goes.I dont know what happened.
And also apart from this problem.The dailog get flickering continously.I have edit control,combox in dialog.Im putting values in all controls in OnPaint().
BOOL CFacePlate::OnInitDialog()
{
CDialog::OnInitDialog();
Bmp1.LoadBitmap(IDB_PVHIGH);
Bmp2.LoadBitmap(IDB_PVLOW);
}
void CFacePlate::OnPaint()
{
CPaintDC dc(this);
m_fPV = oTagBase->GetPV();
m_fSP = oTagBase->GetSV();
if(pv>=oTagBase->GetAlarmHigh())
{
m_Picture.SetBitmap(Bmp1);
}
else
{
m_Picture.SetBitmap(Bmp2);
}
}
Anu
|
|
|
|
|
OnPaint is probably the wrong place to do this - I don't know what control you're using but from my experience with STATIC controls if you send STM_SETIMAGE it invalidates the client area of the control. If your control works the same way then...
- something invalidates the window
- it loads the bitmap
- the STM_SETIMAGE invalidates the window
- it loads the bitmap
- ... ad nauseum
Actually it's in a loop, not an infinite recursion but I hope you get the idea. A better approach would be to isolate the selection of the bitmaps into the control into another message and send that when the stimulus to change the bitmap occurs. This is essentially the basis of the observer pattern.
Cheers,
Ash
|
|
|
|
|
In addition do comment by Ash. Move
if(pv>=oTagBase->GetAlarmHigh())
{
m_Picture.SetBitmap(Bmp1);
}
else
{
m_Picture.SetBitmap(Bmp2);
}
to a separate function, e.g. SetImages() and call this from OnInitDialog. Modify SetImages() to only call SetBitmap if the image actually changed since last call.
Then if possible add an event handler listening for changes in the alarm. If you have no such mechanism implemented you could poll the alarm value using a timer.
|
|
|
|
|
m_Picture.SetBitmap(Bmp1) isnt drawing the pic i guess by not taking the dc as param.
i miss something like
Picture.Draw(dc);
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
You should set the bitmap only when needed, for instance
void CFacePlate::OnPaint()
{
static bool wasAlarmHigh = false;
bool isAlarmHigh = pv>=oTagBase->GetAlarmHigh();
if ( isAlarmHigh != wasAlarmHigh)
{ if(isAlarmHigh)
{
m_Picture.SetBitmap(Bmp1);
}
else
{
m_Picture.SetBitmap(Bmp2);
}
wasAlarmHigh = isAlarmHigh;
}
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
please help
i get this message when i try to build the application. please note that it was converted to visual studio 2010
error C1083: Cannot open source file: '..\..\..\..\..\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\WINMAIN.CPP': No such file or directory C:\Users\Yotam Wimmer\Desktop\Scope files\Copy of ver8hSearchWholeWord\c1xx
i am not sure what the winmain.cpp is but i have found it on my system at "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc"
how can i tell visual studio to look in that path instead of the other one. or is there another solution?
thanks,
yotam
|
|
|
|
|
You should be able to change the path to the file by either opening the .vcproj file in notepad and changing it or by clicking the file in the Solution Explorer and changing the RelativePath property in the Properties window (That's the dock-able properties window, not the one you get from right-clicking)
My current favourite quote is: Punch them in the face, see what happens!
-SK Genius
|
|
|
|
|
thanks you ,legend
|
|
|
|
|
Below are run NOTEPAD. 01001EDC place, in EXE OllyDbg interrupt results:
<br />
01001ED6 |. 8B3D 48120001 MOV EDI,DWORD PTR DS:[<&USER32.CheckMenu>; |USER32.CheckMenuItem<br />
01001EDC |. 50 PUSH EAX ; |hMenu<br />
01001EDD |. FFD7 CALL EDI ; \CheckMenuItem<br />
u can OllyDbg through the upper check into another process EAX value.
How do I use vc + + to write a program that can read the value 01001EDC EAX place?
|
|
|
|
|