|
Blood_HaZaRd wrote: gcc test.cxx Foo.cxx -o Test.o
This is not correct, the output should be your executable file Test (note executables do not have .o extension). You should then be able to run your program by typing Test at the command prompt. Take a look at the man pages for gcc for more information on compile and link options.
|
|
|
|
|
I use method, AttachFile of class CMimeMessage to add a file to mail
CMimeMessage msg;
...
msg.AttachFile(_T("d:\1.txt"), _T("1.txt"));
then use CSMTPConnection::SendMessage(msg) to send this mail, but I find that this mail does not send to my mail box.
The mail account is no problem, because a blank mail can be sent.
I do not know how to use CMimeMessage to send a file ?
|
|
|
|
|
|
This is a C console application in VS2008.
I've got a script language similar to C but the host application has very few debug facilites. With a little modification I can convert the script to plain C and run it in a wrapper in a console app. In the script all variables must start $. If I try to watch a variable $x the watch window says:
$x CXX0017: Error: symbol "x" not found
If I #define $x x it finds it OK but I have to redefine all my variables this way in order to watch them.
Does anyone know why VS doesn't like the leading $ and whether it's possible to configure it to accept it as a normal symbol?
Thanks
A
|
|
|
|
|
This looks like a mistake on Microsoft's part. Even though they allow a variable to start with a dollar sign, the debugger does not seem to recognise it.
|
|
|
|
|
If that is an error... interesting catch...
It wouldn't be the first time one part of the MS IDE doesn't match what another part does.
|
|
|
|
|
Having never used the dollar sign (a Microsoft extension) for identifier names I thought it worth a try.
|
|
|
|
|
Hi,
In my VC++ project I have to draw 2D graphs (X,Y). I would like to know which component I have to use for the same.
Also, The graphs should be rendered at run time continuously for the input values, same like display of ECG machine.
I'm using VS 2010 Express edition..
Hope you have understood my issue, kindly reply,
Regards,
Vijay.
|
|
|
|
|
Cedric had an article on that. I'm not sure if that would suit your needs, but take a look at it: High-speed Charting Control[^]
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Using the Windows GDI is relatively simple once you get used to it. It should be relatively easy to draw 2D graphs with it even at high rates (for high rates, read up on bitblt).
|
|
|
|
|
Hi,
Thanks all, after exploring I could see that I can directly use "Chart" control provided by VS.
~Vijay.
|
|
|
|
|
|
Hi,
Rajesh already pointed out to my chart control article, but just to let you know that I think it will fit perfectly with your case: it was originaly developed for medical applications (one of the use was for ECG).
|
|
|
|
|
I have a console application that is using a DLL that uses a SetTimer() call to create a timer and fire a function within itself. The call is below...
SetTimer((HWND)NULL, 0, timer_num, (TIMERPROC)UnSyncMsgTimer)) == 0)
It is expecting to receive timer messages but this never happens, I assume because mine is a console application and not a standard Windows GUI application (like where the DLL was originally used). This stops a key part of the DLLs functionality from working.
My application needs to stay a console application and I cannot change the DLL.
Does anybody know of a work around to make this work?
Thanks, Joseph
|
|
|
|
|
The following console program works. It sets a timer using SetTimer
then loops in a message loop. The message loop receives and processes WM_TIMER messages
and the timer callback also is called for each time interval.
#define STRICT 1
#include <windows.h>
#include <iostream.h>
VOID CALLBACK TimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime)
{
cout << "Time: " << dwTime << '\n';
cout.flush();
}
int main(int argc, char *argv[], char *envp[])
{
int Counter=0;
MSG Msg;
UINT TimerId = SetTimer(NULL, 0, 500, &TimerProc);
cout << "TimerId: " << TimerId << '\n';
if (!TimerId)
return 16;
while (GetMessage(&Msg, NULL, 0, 0))
{
++Counter;
if (Msg.message == WM_TIMER)
cout << "Counter: " << Counter << "; timer message\n";
else
cout << "Counter: " << Counter << "; message: " << Msg.message << '\n';
DispatchMessage(&Msg);
}
KillTimer(NULL, TimerId);
return 0;
}
|
|
|
|
|
I think he means the SetTimer() call is within the DLL and he can't change that... doesn't he...
...so he just needs to be able to catch the message and make sure the timer ID matches whatever he set...
|
|
|
|
|
Ah ,ok .
|
|
|
|
|
Is the timer function UnSyncMsgTimer exposed by the dll?
If it is you might start your own timer and call it.
0100000101101110011001000111001011101001
|
|
|
|
|
SetTimer((HWND)NULL, 0, timer_num, (TIMERPROC)UnSyncMsgTimer)) == 0)
How do you know the line of code inside the DLL that sets the timer? Do you have the DLL source code?
Best Wishes,
-David Delaune
|
|
|
|
|
That will not work without a message loop.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Hi,
What won't work? I am properly formatting and quoting the code posted by the original poster and asking if he has the source code to the DLL in question.
Best Wishes,
-David Delaune
|
|
|
|
|
Woops, sorry. I guess the DLL won't work unless he implements a message pump.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Hi,
I am using PostThreadMessage & PostMessage to post messages on Thread and Windows respectively. It works fine in most of cases but when there is a high frequency of posting messages then sometimes it misses some messages. I mean message posts successfully but MessageHandler is not called. If I sent 1000 messages then message handler gets call only 990 or 980 times. Can anyone suggest something for this problem? I am too tired now
Thanks,
Rahul Kulshreshtha
|
|
|
|
|
Are you sure that PostThreadMessage() succeeded? If the return value was false, and GetLastError() returned ERROR_NOT_ENOUGH_QUOTA , then your message posting failed because the recipient message queue was full. In this case, you may want to try and post the message after a short delay. The doc is here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms644946(v=vs.85).aspx[^]
The more pressing question is: Why are you posting such large number of messages in a short time, anyways?
"Real men drive manual transmission" - Rajesh.
modified 24-Sep-11 1:16am.
|
|
|
|
|
Rajesh R Subramanian wrote: Why are you posting such large number of messages in a short time, anyways?
Why not? ...good answer but invalid follow-up question...
|
|
|
|