|
try to use __declspec(dllexport) while declare class
Exa:
#define EXT_CLASS __declspec(dllexport)
class EXT_CLASS ClassA : public X
{
...
};
|
|
|
|
|
Thanks.I have used this macro in the dll. And thses errors only occour when I try to compile one certain file(when I compile the other files, VC doesn't give out these errors).
Thanks
Benben
|
|
|
|
|
and I find that these errors only occur when the cpp files in EXE project have such line:
#undef AFX_DATA
#define AFX_DATA AFX_DATA_EXPORT
Maybe it conflict with the static functions or something else in the dll.How to resolve this problem? Could anyone give some idea?
Thanks
Benben
|
|
|
|
|
hey ppl i've been getting this wierd error when i try to add an event to the the activeX control as soon as i hit the add event button it says "Error adding a(n) event to the associated class" anybody know how to correct this?
thanks
|
|
|
|
|
hello all,
I need help.
I have three NIC (Network Interface Card) in same Machine (PC) they connected to network with same subnet mask and gateway address
how to get the second or next IP address with Visual C++ ?
thank u
Tripey
|
|
|
|
|
You will have to enumerate all devices here is a link for some sample code hope that helps
Click ME[^]
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
How I can put my icon on Pushbuttons.
|
|
|
|
|
Here is a link to an article on codeproject might come in handy
Click ME[^]
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Here's another article:
http://www.flounder.com/bitmapbutton.htm
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Does anyone know of an algorithm to calculate a complementary text color given a background color? By this I mean a text color so that the text can easily be read. I've scoured the Web but have not come up with anything useful.
I have low vision, and have difficulty reading the text on some of the controls being developed in my company where the text and background color don't contrast enough. If colors are hard-coded, there will always be some color scheme for which this will not work.
Any suggestions will be much appreciated.
Mihaly Zsadanyi
|
|
|
|
|
IMO all controls should use the system colours for their backgounds and text, that way the user can choose whatever colour they are most comfortable with. Use COLOR_WINDOW or COLOR_3DFACE for backgrounds, and COLOR_WINDOWTEXT or COLOR_BTNTEXT for foregrounds. Any other combinations may look cool, but are disrepectful of the end user.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I'm using Visual C++ to program an application that reading from a .txt file at some time interval, let's say 10 seconds.How can i do this? Please help me. Thank you.
|
|
|
|
|
You have to Set a timer via . SetTimer function
then in the Timeout Handler Read the txt file (use CFile )
if you have a Dialog based Application
then in OnInitDialog
SetTimer(1,10000,NULL);
add handler for WM_TIMER event (via Class Wizard)
..... OnTimer(UINT nIDEvent)
{
}
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Hi,
I need to use USB to interface between a hardware and PC. What command/tool should I use? Any sample code?
|
|
|
|
|
I don't realy know USB,but I think the hardware should provide that tool or the driver lib.
Thanks
Benben
|
|
|
|
|
Hi,
What is the difference between using CClientDC to draw graph and using CDC?
|
|
|
|
|
basicly nothing. The only difference is that CClientDC calls GetDC() on the supplied window in it's constructor, and calls ReleaseDC() in it's destructor. It just saves you some typing and debugging time.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I had create a SDI with database. How do I maximize the dialog permanently?
I drawed some pictures on the dialog. When I maximize the dialog, there's a assertion error. What should I do?
|
|
|
|
|
|
hi,
I want to convert the string '\device\harddiskvolume1\windows\..' to the path 'c:\windows\..'
I get that string from the registry. I can replace the string
'\device\harddiskvolume1' to c:
'\device\harddiskvolume2' to d:
etc.
But I doubt there is a much better way using some API.
Can anyone please help ?
regards
hari
Hari Krishnan
|
|
|
|
|
How can i get the path of my dll on disk from within that dll?? Like.. a program loads my dll as a plugin but the dll itself doesnt care where it is. Is there a way to get the path to the dll from within the dll code?
Thanks
Kuniva
--------------------------------------------
|
|
|
|
|
Kuniva wrote:
but the dll itself doesnt care where it is
I wouldnt say that was 'accurate' .. there's a set path windows uses to locate dll's .. from memory, its (very roughly), assuming NT for the moment
1) The directory the calling exe was loaded from
2) C:\winnt
3) C:\winnt\system32
4) The Contents of the PATH Environment variable
so the dll has to be 'somewhere useful' .... so you could use the file find functions ... checking that the above list was accurate, of course ...
As far as I recall, the info isnt stored 'within' a dll... The only other way may be to enumerate processes and maybe the process stack shows where it was loaded from - www.sysinternals.com has some tools that may demonstrate this .. but thats way complex !!!
Most 'plugin' factories to use a better word should have a configurable parameter that says, 'my plugins are in here' and not assume they are anywhere, imho ..
hth
|
|
|
|
|
A guess:
Try GetModuleFileName() passing in the instance handle of the dll. The handle is the first parameter passed into your DllMain() function, or it can be retrieved using the AfxGetInstanceHandle() function if you are using MFC and your dll was linked with the USRDLL version of MFC.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hello,
I have the following simple code and I cant understand the results I am seeing
Note. This is a big hack in an old peice of code. It would not be like this if I had my way
void SomeFn(void)
{
//these are not hard coded they come from another API in string form
CString result = CalcMargin("0.7033", "0.7000");
}
CString CalcMargin(LPCTSTR exeRate, LPCTSTR rate)
{
double dExeRate, dRate, dMargin;
dExeRate = atof(exeRate);
dRate = atof(rate);
dMargin = dExeRate - dRate;
result.Format("%f", dMargin);
return result;
}
The returned value is "0.003300" and I wondered why i see the trailing zeros. It turnes out that the result of the subtraction is 0.0033000000000001
Can anyone tell me why?
Thanks
|
|
|
|
|
Try this
result.Format("%5.4lf", dMargin);
where 5 is the minimum width and 4 is the precision.
the lf is for double values.
|
|
|
|