|
I need load two DLL, a.dll and b.dll.
In a.dll has fun() function and b.dll has fun() too.
How to distinguish between a.dll/fun() and b.dll/fun().
|
|
|
|
|
|
hanlei0000000009 wrote: In a.dll has fun() function and b.dll has fun() too.
How to distinguish between a.dll/fun() and b.dll/fun().
Using GetProcAddress and a typedef (with different names) for prototyping the function should help.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
I need to display icons in my TreeCtrl , icon image should change depending on the tree node type.
If it is Root node I need to display one icon. And for branches which is having child items I need to dispay different icon. For child items with no roots I need to display separate icon.
How do I know the nodes which are having child items ?
Presently iam able to show only one icon to all nodes.
m_lstImages.Create( 16, 16, ILC_COLOR, iconCount, 1 );
for( int i = 0; i < iconCount; i++ )
{
HICON hIcon;
hIcon = AfxGetApp()->LoadIcon( IDI_ICON1 + i );
m_lstImages.Add( hIcon );
}
GetTreeCtrl().SetImageList( &m_lstImages, TVSIL_NORMAL );
|
|
|
|
|
Preethi_123 wrote: How do I know the nodes which are having child items ?
Use CTreeCtrl::ItemHasChildren
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hi all,
This is my constructor:
CUpdateServiceModule::CUpdateServiceModule()
{
m_status.dwControlsAccepted |= SERVICE_ACCEPT_PAUSE_CONTINUE;
m_bIsRunning = FALSE;
m_bIsPaused = FALSE;
MessageBox(NULL, L"Contructor",NULL, NULL);
}
I am wondering why the message box constructor appears when ever I rebuild my project, install the project and uninstall the project. Can anyone tell me why is that or what information do you guys need to know that?
Thanks,
jayjay
|
|
|
|
|
because the constructor function of CUpdateServiceModule() will be called by the com register.
【成功就是在跌倒之后还能爬起来...】
|
|
|
|
|
even during uninstall and building?
|
|
|
|
|
When building your project, VC will register the component at the end of the compilation, thus the message box is shown.
And I guess an instance of that class is created when the component is unregistered (during an uninstall).
|
|
|
|
|
|
register and unregserver message during uninstall and building.
【成功就是在跌倒之后还能爬起来...】
|
|
|
|
|
monsieur_jj wrote:
CUpdateServiceModule::CUpdateServiceModule()
{
m_status.dwControlsAccepted |= SERVICE_ACCEPT_PAUSE_CONTINUE;
m_bIsRunning = FALSE;
m_bIsPaused = FALSE;
MessageBox(NULL, L"Contructor",NULL, NULL);
}
Be careful with the m_status.dwControlsAccepted .
The way the statement is written it will most likely contain garbage data when you build for release, unless it's initialized in some base class of CUpdateServiceModule .
Consider changing to
m_status.dwControlsAccepted = SERVICE_ACCEPT_PAUSE_CONTINUE;
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I get similiar other warnings such as
warning C4996: 'strcat' was declared deprecated
warning C4996: 'fopen' was declared deprecated
warning C4996: 'itoa' was declared deprecated
why and when do these warnings arise ?
How to overcome them?
- thanks..
|
|
|
|
|
kapardhi wrote: why and when do these warnings arise ?
Because Microsoft introduced more secure versions of these functions. So either follow the advice given in the warning message (use the more secure version, like strcat_s) or disable the warning 4996 (you can specify that in the project options).
|
|
|
|
|
* You may suppress all the compiler warnings using /w option.
or
* Use /wd to supress a specific warning. Eg. /wd4996 will disable the compiler warning with ID 4996.
Regards,
Rane
|
|
|
|
|
I am using Visual c++ 6.0 MFC,
I have a problem to print pay slip on Dot Matrix printer. So I need to write my data on Text File and after Printing it.
Clearly, How can I Write to Text File et Print this File After with Visual c
++ 6.0 MFC.
Thanks
|
|
|
|
|
You can play with files in MFC using CFile class. Below shown code snippet will be of little help:
CFile cf_object;
cf_object.Open( "c:\\CP\\CP_test.txt", CFile::modeCreate|CFile::modeWrite);
char szText[100];
strcpy(szText, "File Write Test");
cf_object.Write (szText,100);
Regards,
Rane
|
|
|
|
|
|
These guys are fast. Let me add up something that has not been said yet:
You can open the port to which the printer is attached (usually LPT1) as a file (just pass LPT1 as the file name to the function which opens or creates the file). You can then just write text to this opened file, and you'll see the printer is printing it out. If you consult with the printer documentation, it must have some specific ASCII command patterns (known as EPSON ESC CODE sequences), which you could follow to get formatted output, such as a receipt.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Hi All
I want to convert MDI application code to dailog application code.Can any one help me which class i need to write in dailog application..
Or can i show MDI Out put on dailog application in list box?
Example link in here http://www.codeguru.com/cpp/w-p/clipboard/externallinks/article.php/c9155/[^]">
Plz help me..
modified on Monday, September 1, 2008 2:03 AM
|
|
|
|
|
What does the link have to do with your question ?
Anyway, there's no easy way to convert a MDI application to dialog based application. You need to restart a new project and copy/paste the classes and code you need. Of course, this is probably more complicated than that because the structure of the project changes completely.
|
|
|
|
|
Ok Can i show MDI out put on Dailog Application?
|
|
|
|
|
What do you mean ? If you want to put your MDI app contained on your dialog, that's not possible. Think a bit about it: you can have multiple documents open at the same time, how would do you put that on one single dialog ?
No, the best way to go is to completely rewrite your application and reuse part of the code. Otherwise this will be a complete mess.
|
|
|
|
|
ok can you give me some example how can i stat to rewrite application..
Plz help me
|
|
|
|
|
Not really no, because it completely depends on what you want to implement. The only advice I can give you is to create an empty dialog based application and then to add features little by little.
But converting from a MDI application to a dialog based application seems a very awkward choice, because the structure of your program and the way the user interacts with it are completely different. Are you sure you want to do such a thing ? What's the reason behind that choice ?
|
|
|
|