|
Thanks CPallini,
This is exactly what I am looking for.
regards,
George
|
|
|
|
|
Georges,
you have redundant declarations:
"extern "C" __declspec(dllexport) __stdcall BOOL WINAPI StoreData(DWORD dw)"
__stdcall is wrongly placed. it should be after the return type.
WINAPI is already defined for your function. remove it, and place __stdcall instead
|
|
|
|
|
Thanks toxcct,
From MSDN I have not found __stdcall grammar, about which is the correct place -- as you mentioned after return type. Are there any documents mentioning the grammar?
regards,
George
|
|
|
|
|
George_George wrote: From MSDN I have not found __stdcall grammar, about which is the correct place -- as you mentioned after return type. Are there any documents mentioning the grammar?
liar, you saw CPallini's answer[^]...
|
|
|
|
|
Thanks, I also found it. I missed his reply before.
regards,
George
|
|
|
|
|
George, this sounds like quite a neat trick and potentially useful for sharing/porting code modules between compilers e.g. Borland/Microsoft. Why don't you write this up, the reasons for wanting it and an little example as an article for Code Project. I for one would be interested.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Matthew,
From the discussion with others here, I looks like stupid. Everyone else seem know the answer.
regards,
George
|
|
|
|
|
Hi All
i am asking one more time,how to copy Folde?Becouse i haven't found Shfileoperation() example.Plz give me some runing example of Shfileoperation.Plz help me
Thanks in advance
|
|
|
|
|
The last time you asked you were given a link to a very good article by Michael Dunn. Have you even bothered to look at it?
|
|
|
|
|
It was good artical.But i need very simple example.becouse i am new in vc++.
Plz help me
|
|
|
|
|
|
Davitor wrote: But i need very simple example.
That's as simple as it gets. Anything simpler and we'd have to come over and do the work for you.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
you welcome
|
|
|
|
|
Hi,
How can I know the number of serial ports on my computer using code?
Thanks,
|
|
|
|
|
|
|
You're welcome.
|
|
|
|
|
You may try this !
#define MAX_AVAIL_COM_PORTS 250
int i = 0;
char chTemp[3];
CString strCOMPort;
HANDLE hndCurrCOMPortObj;
for (i = 0; i < MAX_AVAIL_COM_PORTS; i ++)
{
itoa (i + 1, chTemp, 10);
strCOMPort = "COM";
strCOMPort += chTemp;
// Create handle for selected COM port and check its Avilability
hndCurrCOMPortObj = CreateFile (strCOMPort,GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
if (INVALID_HANDLE_VALUE == hndCurrCOMPortObj)
{
strCOMPort += strCOMPort + " port not available !!";
AfxMessageBox (strCOMPort);
}
else
{
strCOMPort += " port Available !!";
AfxMessageBox (strCOMPort);
CloseHandle (hndCurrCOMPortObj);
}
}
|
|
|
|
|
It won't work for ports having number >= 10 .
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks !
i didn't knew this !!
but can u plz tell me the reason why this doesn't work ?
and can you give a solution to it, bcoz i need the requirement must be fullfilled in a small code rather that importing those classes !!
|
|
|
|
|
kapardhi wrote: i didn't knew this !!
I suspected so.
kapardhi wrote: but can u plz tell me the reason why this doesn't work ?
Because you must use UNC [^] names for serial ports with number >= 10 , e.g. port 12 UNC is \\.\COM12 (you may use always UNC names).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
may i know how to save and load a .xml by using c++ in MFC?
can send me any link?
thanks
|
|
|
|
|
You may use MSXML . Samples here [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|