|
|
How to define current directory? Actually a directory from which program started. And a back side of this: how to define whether file exist in a specified path ?
|
|
|
|
|
Take a look at "GetModuleHandle" and "GetModuleFileName"
GetModuleHandle will return a handle to the currently running app.
Use the handle in GetModuleFileName to get the path of the module...or you app.
You can also use GetCurrentDirectory().
That should do it.
Hope this helps
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I'm creating three to four socket client threads. Each one connecting to a different socket server.
At the creation of my threads I'm passing a pointer to a struct.
As each thread accesses this struct, will they see everything that the other threads see or will the struct be set in it own memory slot and only see data for that thread?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
All threads will see the same struct.
|
|
|
|
|
Im just stumped. Anyone know of a good article or demo
project which shows how to put a menu in a CDialog? I
just want to create a simple menu for a CDialog based
application.
Please, any response any one can give me will be
greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
First create your menu in in the resource editor. if you have not added a menu then you will need to add one first.
After you've created your menu then in your dialog attach it. In .Net look in the properties menu for your dialog screen. In VS 6.0 right click on your dialog screen and choose properties. In the first tab you will see a drop down to choose your menu ID that you wich to use.
Hope this helps
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hi,
I need to crank out a quick, lightweight error reporting helper application, and would like to add a screenshot to it. I have a rough idea how I would do that, but do you know something "out of the box"?
Related: I'd love to save this to an e-mail file (including the image as attachment). Any lightweight helpers for that?
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
I want to put Skin of a PNG image on scrollbar of richedit control.how can i.
Learner always
|
|
|
|
|
When VS genereates a binary it writes full local path to pdb file as a string to it.
For example C:\Solution\Project\Release\Project.pdb
How to disable this and maybe other private information leackage?
|
|
|
|
|
What if you don't generate the PDB in the first place?
Then it might not write anything.
|
|
|
|
|
What do you by 'first place'?
Tried to switch to Debug and clean then back to Release and no success. String with path still presents even if pbd file doesn't exists.
|
|
|
|
|
This is what I meant...
Assuming Visual C++ 6.0 (You may have to search around for similar for VC 7.X or later...)
Open the Project Settings.
Make sure the 'Settings for' mentions your release build, typically 'Win32 Release'.
Go to the 'Link' tab.
Change the Category combobox to say 'Customize'
Make sure the 'Use Program Database' in NOT checked.
Change the Category combobox to say 'Debug'
Make sure that 'Debug Info' is NOT checked.
This will make your release EXE as much as possible without any symbols or line number information in it.
Make sure you do a Rebuild All after changing the settings.
Some companies build a release with enough symbolic information to use the PDB files to debug the release builds. Yours might have been set up or changed to be this way. The steps above will undo those changes.
|
|
|
|
|
Oh! No idea why I didn't find that menu before.
Thanks a lot! Now the binary is a little bit cleaner.
|
|
|
|
|
Hi
I'd like to know how get why LoadLibrary has failed. The error that I'd like to get is the unresolved symbol or dll that the loader cannot find. Like run a process using Explorer. If the .EXE depends of a DLL that do not exists or a function that is not exported by the DLL, the Explorer says the DLL file name or function name that could not be found.
|
|
|
|
|
I'm not sure if I understand you well...
If LoadLibrary fails, it returns NULL, otherwise it returns a handle to the dll module. To know why the function failed, call GetLastError.
Take a look at the MSDN, this might help you.
|
|
|
|
|
But GetLastError do not say what export or dependency could not be resolved. GetLastError only returns the error code.
|
|
|
|
|
When you call LoadLibrary, the dll is explicitly imported that means you'll have to get the adress of all the functions you want to call (using GetProcAddress). So this is normal it doesn't give you an error message to tell which function is not resolved. What you are talking about happens when you import implicitly a dll.
|
|
|
|
|
Yes, but my problem is the dependencies for the dll that is being loaded. Supose that my DLL depends of another DLL (some.dll) that is not present on a system. How to know that LoadLibrary has been failed because the DLL some.dll is not present ?
|
|
|
|
|
To figure out what DLL your program is not able to load:
(1) Install the "FileMon" utility from sysinternals.com.
(2) run it, and have it watch your application.
(3) when it comes time to load the dll, you can scan through the log for file-not-found errors and things like that... very useful!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Thxs. But for this I use dependency walker www.dependencywalker.com
|
|
|
|
|
|
Is there any API to judge if card be inserted into the socket of a cardreader?
|
|
|
|
|
This is hard to say, Does your card reader come with an API? If so does it have a function that returns the card readers state?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
yeah,
i think you r talking about SMart Cards.
i think you shd study documentation od Card Raeder Carefully,it may returning some interuppt may be you are not monitoring the card reader very time or you app.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|