|
ccpptrain wrote: DialogBoxParam(hInstance,
How are you getting the instance handle? It should be the one you get in DllMain as an argument.
|
|
|
|
|
|
I am passing NULL for instance.
Well, I will try your suggestion
|
|
|
|
|
Thanks Nibu it is working.
|
|
|
|
|
Figure out what is done the the macro.
Greetings from Germany
|
|
|
|
|
How can I instruct Visual Studio 2005 to include a certain DLL as a compile-time dependency of the EXE even though my code never calls any functions in the DLL?
It's a resource-only DLL, but I want Windows to load it into the process when the process launches without me having to call LoadLibrary.
I figure since no functions are ever called, the linker would ignore it by default.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
If it is a resource dll you need the HANDLE to set it to "Current Resource Handle".
If you only need the resources, you can also change the resource code of your exe module.
Greetings from Germany
|
|
|
|
|
Maybe export one function - the function could just return the HMODULE for the DLL, which you'll
need anyway. Create an import library in the DLL project and link to that library in your app
project.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Place the following in one of the source files for your exe:
#pragma comment(lib, "mydll")
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Thank you! That seems to be the best solution!
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Hi,
I have a CListCtrl with the option "show selection always" enabled. If the cotrol lose its focus the selection is become gray. Is there any solution to keep the selection always highlighted (blue default color) even the focus is lose ?
Regards,
sdancer75
|
|
|
|
|
Make your ListCtrl partially ownerdrawn. Michael Dunn wrote a nice article about it here at CP.
Greetings from Germany
|
|
|
|
|
my app allows the user to change the current time on the pc and it also displays the current time at the bottom of the apps window (its a full screen app so the user can't see the windows time).
I've noticed that when I change the time in my app it changes correctly however the windows timer gets an extra hour added, I'm assuming this is due to BST, what is the preferred method for changing the time correctly so I don't get this extra hour?
TIA,
Andy
|
|
|
|
|
Lookup SetLocalTime also read remarks section in the docs carefully.
|
|
|
|
|
mcsherry wrote: I'm assuming this is due to BST...
British Summer Time
Brazil Standard Time
Bering Strait Time
Business Software Technology
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm going with the third one...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I would like to know which function I can use to count the number of threads associated with a specific thread. i.e. How many threads does a specific process have?
Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Look up the functions:
Thread32First, Thread32Next<br />
<br />
These are used after you create a snapshot with:
<br />
CreateToolhelp32Snapshot
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
|
Programm3r wrote: I would like to know which function I can use to count the number of threads associated with a specific thread. i.e. How many threads does a specific process have?
Along with the reply that you already got see this link[^] too.
|
|
|
|
|
|
Hello.
I'm new in Socket Programming and I found that the sample program in this page is easy to understand.
Attached sample project is working fine in Microsoft Visual C++ Express Edition.
But I had a problem when trying to make an exact copy of the program,
by creating new empty project and add the sources ( attached "sock.h", "sock.cpp", and "main.cpp" ) to the project.
When I trying to build the project, there's some errors as below.
1>Compiling...
1>main.cpp
1>sock.cpp
1>Generating Code...
1>Linking...
1>sock.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function "public: static void __cdecl openutils::CWinSock::Initialize(void)" (?Initialize@CWinSock@openutils@@SAXXZ)
1>sock.obj : error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function "public: static void __cdecl openutils::CWinSock::Finalize(void)" (?Finalize@CWinSock@openutils@@SAXXZ)
1>sock.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced in function "public: void __thiscall openutils::CServerSocket::Close(void)" (?Close@CServerSocket@openutils@@QAEXXZ)
1>sock.obj : error LNK2019: unresolved external symbol _htons@4 referenced in function "private: void __thiscall openutils::CServerSocket::Init(void)" (?Init@CServerSocket@openutils@@AAEXXZ)
1>sock.obj : error LNK2019: unresolved external symbol _inet_ntoa@4 referenced in function "public: char const * __thiscall openutils::CSocketAddress::GetIP(void)" (?GetIP@CSocketAddress@openutils@@QAEPBDXZ)
1>sock.obj : error LNK2019: unresolved external symbol _gethostbyname@4 referenced in function "public: char const * __thiscall openutils::CSocketAddress::GetName(void)" (?GetName@CSocketAddress@openutils@@QAEPBDXZ)
1>sock.obj : error LNK2019: unresolved external symbol _connect@12 referenced in function "public: void __thiscall openutils::CSocket::Connect(char const *,int)" (?Connect@CSocket@openutils@@QAEXPBDH@Z)
1>sock.obj : error LNK2019: unresolved external symbol _socket@12 referenced in function "public: void __thiscall openutils::CSocket::Connect(char const *,int)" (?Connect@CSocket@openutils@@QAEXPBDH@Z)
1>sock.obj : error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function "public: void __thiscall openutils::CSocket::Connect(char const *,int)" (?Connect@CSocket@openutils@@QAEXPBDH@Z)
1>sock.obj : error LNK2019: unresolved external symbol _send@16 referenced in function "public: int __thiscall openutils::CSocket::Send(char const *)" (?Send@CSocket@openutils@@QAEHPBD@Z)
1>sock.obj : error LNK2019: unresolved external symbol _recv@16 referenced in function "public: int __thiscall openutils::CSocket::Read(char *,int)" (?Read@CSocket@openutils@@QAEHPADH@Z)
1>sock.obj : error LNK2019: unresolved external symbol _accept@12 referenced in function "public: class openutils::CSocket * __thiscall openutils::CServerSocket::Accept(void)" (?Accept@CServerSocket@openutils@@QAEPAVCSocket@2@XZ)
1>sock.obj : error LNK2019: unresolved external symbol _listen@8 referenced in function "public: class openutils::CSocket * __thiscall openutils::CServerSocket::Accept(void)" (?Accept@CServerSocket@openutils@@QAEPAVCSocket@2@XZ)
1>sock.obj : error LNK2019: unresolved external symbol _bind@12 referenced in function "public: class openutils::CSocket * __thiscall openutils::CServerSocket::Accept(void)" (?Accept@CServerSocket@openutils@@QAEPAVCSocket@2@XZ)
I suppose that the errors came from different "Project Properties".
Anybody could help me?
I using Microsoft Visual C++ Express Edition 2005 with Microsoft Platform SDK for Windows Server 2003 R2 installed.
|
|
|
|
|
You need to link to the winsock library: go into the project properties -> 'Linker' -> 'Input' and in 'Additional dependencies' you need to add 'ws2_32.lib'.
|
|
|
|
|
maglev_tgv wrote: I suppose that the errors came from different "Project Properties".
Your guess it is right.
You have to add Ws2_32.lib to the LINKER library list.
On my system (VS 2003) this can be done by selecting 'Project->Properties" menu and then (on the newly shown window), after selecting the 'Linker->Command Line', add Ws2_32.lib to the 'Additional Options' TextBox.
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.
|
|
|
|
|
It Works!!
Thank you very much( for both Cedric Moonen and Pallini ).
You just made my day.
I also added "odbc32.lib", "odbccp32.lib", "wsock32.lib" to Additional Dependencies,
and it works. But it was derived from yours, so thanks.
There were no error anymore when building,
but when I debug it, there was a dialog bog:
image
I chose OK and there were no problem ( and the server worked fine ).
Just curious. Any suggestions?
|
|
|
|