|
You can:
1) Load programmatically the DLL using LoadLibrary(). In this case you have to load the functions entry points the dll exports via GetProcAddr()
2) Usually DLLs come with a LIB file. Include the LIB file into your project. The functions exported by the DLL are now available.
3)Use the delay loading feature with the /delayload:dllname linker switch
|
|
|
|
|
Use CoCreateInstance()
You should know how to invoke a COM and work with COM objects.This applies when you have the class id of the interface.
else
You can also use LoadLibrary() alongwith GetProcAddress() to invoke the functions
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 6:18 Tuesday 13th June, 2006
|
|
|
|
|
FutureSE wrote: how to call or integrate DLL within vc++ application.
I have developed one vc++ application now i want to integrate one tool into this application which ll cal this DLL.
reply soon
Try GetModuleHandle which returns the handle of your DLL through which you can get the addresses of the method using GetProcAddress..
The GetProcAddress Fails when the method is Mangled (in case of C++ Dll).
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
ok i ll try tht n get back to u
FutureSE
WhiteHawk
|
|
|
|
|
Good luck.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
in project setting , under link tab give reference to the .lib file, give its path.
in your program add the header file..
header file should have
__declspec (dllimport) <funname classname="">
not
__declspec (dllexport) <funname classname="">
go get going.
|
|
|
|
|
I'm experiencing an odd behaviour with GetTextMetrics() (used sooo many times).
I've created two fonts with CreateFont.
Select the first font in the device context (PDFWriter printer device context) and do a TextOut().
To increase the y, I call GetTextMetrics() to read the tmHeight and tmExternalLeading values but the program hangs on GetTextMetrics().
If TextOut is not called, GetTextMetrics works.
I'm using VC++ 6.0.
|
|
|
|
|
Nyarlatotep wrote: 've created two fonts with CreateFont.
Select the first font in the device context (PDFWriter printer device context) and do a TextOut().
To increase the y, I call GetTextMetrics() to read the tmHeight and tmExternalLeading values but the program hangs on GetTextMetrics().
If TextOut is not called, GetTextMetrics works.
You may need to select the font again so that the device context gets new tmHeight and tmExternalLeading values that you updated.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
uhm. the code is like this ...
SelectObject(hfont1);
GetTextMetrics(hdc,tm1); // it works
TextOut(hdc, ....);
y += tm1.tmHeight + tm1.tmExternalLeading;
SelectObject(hfont2);
GetTextMetrics(hdc,tm2); // it hangs the program
if TextOut() is not called, the second GetTextMetrics() does not hang.
The only solution i've found is to retrieve all the text metrics before doing any TextOut()
SelectObject(hfont1);
GetTextMetrics(hdc,tm1);
SelectObject(hfont2);
GetTextMetrics(hdc,tm2);
SelectObject(hfont1);
TextOut(hdc, ....);
y += tm1.tmHeight + tm1.tmExternalLeading;
...
...
-- modified at 5:44 Tuesday 13th June, 2006
|
|
|
|
|
Nyarlatotep wrote: SelectObject(hfont1);
GetTextMetrics(hdc,tm1);
SelectObject(hfont2);
GetTextMetrics(hdc,tm2);
I have tested that when you create the font and retrive the external leading it returns '0' mostly.
why you don't try using the tmHeight parameter of the CreateFont when tmExternalLeading is 0 without making call for GetTextMetrics repeatlly.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I could. But GetTextMetrics() is called only at the beginning of the code and not every time TextOut is called.
The question is why GetTextMetrics hangs. Never happened before !!!
|
|
|
|
|
Nyarlatotep wrote: The question is why GetTextMetrics hangs. Never happened before !!!
This may due to following.
-You have taken the device context of the printer where lots of jobs may pending
-When you get the device context of printer and textout the text the device context is in use while jobs may pending or your process is not scheduled.
-and you are trying to get/set the information of the device context which may denied as exclusive access to device context
Hope you got the issue.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
please try the following code:
---------------------------------------
hOldFont = SelectObject(hfont1);<br />
GetTextMetrics(hdc,tm1);<br />
TextOut(hdc, ....);<br />
y += tm1.tmHeight + tm1.tmExternalLeading;<br />
<br />
SelectObject(hdc, hOldFont);<br />
DeleteObject(hfont1);<br />
<br />
hOldFont = SelectObject(hfont2);<br />
GetTextMetrics(hdc,tm2);
---------------------------------------
|
|
|
|
|
Selecting the old font and destroyng hfont1 works.
But in this way i've to re-create hfont1 each time (i use it in many places along with hfont2).
|
|
|
|
|
Hello,All
I have a application by Win32.I want to package it.
Please help me .
Thanks ...
|
|
|
|
|
Use NSIS installer for packaging it..you just have to write a simple script for that.
You can download the nsis installer from here[^]
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Package as in make an installer? The good free ones should be Inno Setup and NSIS.
|
|
|
|
|
Tran Ngoc Minh wrote: I have a application by Win32.I want to package it.
Please help me .
Use setup and deployment projects wizard of the VS2003
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hope I understood your question
one way that you dont need to any software you can use from IExpress.exe in XP from start menu and in window Run enter IExpress.exe now you can see a window Welcome
whitesky
|
|
|
|
|
Hi all,
My question is here :
To create a console application with the Class Hierarchy for the below XML Structure.
<Employees>
<Employee>
<name>Malar</name>
<designation>SE</designation>
<reportingTo>
<Employee>
<name>Prakash</name>
<designation>PL</designation>
</Employee>
</reportingTo>
</Employee>
</Employees>
//******************
I have to write a C++ program to add, modify, delete type application.
This application should append, delete, or modify the XML file.
I think each tag should be represented as seperate class since we have append the XML as tags
Advance thanks for the one who will help to solve the problem,
Regards,
Karthik M
Karthik M
|
|
|
|
|
karthikoncodeproject wrote: I think each tag should be represented as seperate class since we have append the XML as tags
This is not a good idea: imagine, you want to add a new tag. Then you have to create another class... Not very practical.
Take a look at tinyXML[^], it's a quite powerfull library.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
See IXMLDOM* interfaces which provides what you want.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Thanks for your valid suggestions.
But i have to write a C++ code manually for an assignment.
Kindly design a class for the above mentioned XML hierarchy.
Regards,
Karthik M
Karthik M
|
|
|
|
|
Hi,
Can someone explain why this code crashes (when calling ReleaseBuffer()) ?
<br />
#define PROFILE CString("config.ini");<br />
CString result;<br />
GetPrivateProfileString("MySection","MyString","",result.GetBuffer(),512,PROFILE);<br />
result.ReleaseBuffer();<br />
And how can I avoid this ?
|
|
|
|
|
I think you should specify the size of the allocated buffer:
GetPrivateProfileString("MySection", "MyString", "", result.GetBuffer(512), 512, PROFILE);
|
|
|
|