|
See, I have this car physics simulation that uses SDL. I've placed all the lib and dll files in a sub directory and I'd like to have so that anyone can just double click the exe file and play around with it without having to copy any .dll's to the system32 directory or anywhere.
Now in the project properties > Linker > Input > Additional Dependencies I'm specifying SDL.lib (along side other libraries) and providing the relative path for SDL.lib in the project properties > Linker > General > Additional Library Directories. That works fine on my laptop because I have the SDL.dll in windows > system32 but if I copy the directory to a different computer it complains about not finding the SDL.dll and that reinstalling might help fix the problem.
So is it possible to tell it to look in a different directory than the system32 for dll's ? if so, how do I do that?
P.S. I'm using visual studio 8.
Many thanks,
Hasan.
|
|
|
|
|
|
Can LoadLibrary () help you?
I use third party dll in my programm and I dont need to copy it in system32 folder, but DO in the app folder. So you can make it running from your application folder. Or just another fixed folder and specifying it when loading.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Thanks Nelek, I'll give it a shot as soon as I get back home,
by the way, I never realised that the path of the exe is the first search path for dll's, I've been able to run the exe just by placing the SDL.dll next to the exe but I guess doing it with the LoadLibrary () would look much better.
Thanks for the help
"Low level programming is good for a programmer's soul". says John Carmack
|
|
|
|
|
Actually, as far as I know, is the actual path (when File.. Open.. it changes) the first one searched. By default is the App-Path when nothing changes it during execution time.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I eventually used the SetDllDirectory ( )... much easier than LoadLibrary ( ).
this is how it looks like:
SetDllDirectory(L"../dlls/SDL-1.2.12/lib"); // No idea what the 'L' is for
It worked out fine so thanks everybody you for the suggestion..
"Low level programming is good for a programmer's soul". says John Carmack
|
|
|
|
|
Hi!
A user maximizes the application on monitor #2 and then exits the program. When starting up again, trying to maximize the window using ShowWindow(SW_MAXIMIZE) maximizes the window on monitor #1, instead of the expected #2.
Is there any way to set the preferred/active monitor? Optimally, a subsequent call to ShowWindow(SW_MAXIMIZE) should then maximize the window on monitor #2.
Thanks and best regards
Dominik
|
|
|
|
|
Yes, use GetWindowPlacement to record the window max/min state, size, and monitor when the app exits, store the returned struct as binary data in the registry (or elsewhere), and the use SetWindowPlacement when the app boots the next time. Don't forget to handle bizarre situations as when a user discards a monitor or changes screen resolution.
|
|
|
|
|
Has anyone implemented secure IPC? I need to implement something in native code, and I need some direction.
Is there a way to have my processes dynamically generate public/private key pairs and use that kind of encryption?
|
|
|
|
|
Independent123 wrote: Is there a way to have my processes dynamically generate public/private key pairs and use that kind of encryption?
The CryptoAPI[^] tools have worked well for me. They're high level APIs
so relatively simple to use.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ah, yes! Thanks Mark, that seems to be what I need!
|
|
|
|
|
Hi friends..
Any one of you had developed the code for Integer DCT in c or C++ or in MATLAB? if so plz let have the code. I need it for my research. Plz let me share that. Thanks in advance..
Sivadanams
|
|
|
|
|
Quoting Chris Maunder:
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
George
-- modified at 14:50 Saturday 27th October, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
hi all
I need to change picture in my dialog, when user push some button.
it is firts time when I use Picture control im my dialog.
help me if you can.
|
|
|
|
|
Are you using MFC or straight Win32 APIs?
The basic steps are:
1) respond to button press
2) load a new bitmap for the picture control
3) set the picture control's bitmap to the new bitmap
Which part are you having trouble with?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have problem with step #3 I cant replase bitmap .
|
|
|
|
|
thanks
I Find in MSDN class CStatic and I solve my problem using this class.
|
|
|
|
|
If you want to set picture to a control like Static you can use of SetBitmap that it gets a hbitmap for parameter and also use of LoadImage or CImage class for load image.
|
|
|
|
|
Hi,
I have a DLL write in VC , in this DLL a function is declare follow :
BOOL InitMyDLL(LPWORD Alpha, LPWORD wrdpack);
now i want use this function in my VB project , but any type get for LPWORD (Inteeger , long , double ,...) and run my project when this function call get this error :
run-time error '49':
bad DLL calling convertion.
I Declaration this function in VB follow :
private declare Function InitMyDLL lib "MYDLL" (ByRef Alpha, Packet() as long) as Boolean
second parameter is a array !!!
please help me,
thanks for all.
|
|
|
|
|
i am new to vc++ programming and i want to make an invisible text box visible during runt time. i made the variable name with type CString for that text box. Can anybody help me in solving this problem.
|
|
|
|
|
you said you made the variable with type CString. thats fine.
you also create one variable for that same text box as type CEdit from class wizard.
now, whereever you want to hide it,
call as follows.
variable.ShowWindow(FALSE);
or you can do like this also, but iam not sure
GetWindow(IDC_EDIT1)->ShowWindow(FALSE);
obviously, make it TRUE to Show it.
Good luck.
-- modified at 3:59 Saturday 27th October, 2007
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
|
I think this can be done by right clicking the Edit box----properties--->select the "Visible"(checked).(in the Resourse View)
Or
u can do it using the same command as chandu told..
i.e., GetDlgItem(IDC_EDIT)->ShowWindow(TRUE)
I thnk this command brings you the solution.
Thanks,,
saravana...
|
|
|
|
|
Chandu's answer is right. But don't use the code in the OnDraw () or OnPaint () messages, you will start a loop or update the window. Put it in a button, mouse click or something like that
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
in my vc project: i write assembly codes (with __asm keyword). i compile my project in windows 32 bit, it has any error. BUT in Windows 64 bit, it doesn't know __asm keyword and other assembly instruction. what do i do?
Zo.Naderi-Iran
|
|
|
|