|
roadragedave wrote:
wsprintf(sz, _T("Load Percentage: %i\n"), V_BSTR(&vVal));
This is not right at all. The %i type is for signed decimal integers, which is not what V_BSTR() returns. When the V_BSTR() macro is expanded, notice that it accesses the bstrVal member of the VARIANT structure, not the intVal member. You've simply masked the problem.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I get what you mean, however the function that gets vVal passes it back as uint16 , VARIANT , I presume, is a generic data type that holds almost all simple data types and what is needed it to convert to say string, double, BSTR .
Using %s threw and exception and I could not figure out using the debuging what exactly was going wrong, I took a chance and changed it to %i , and the application works.
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
roadragedave wrote:
...the function that gets vVal passes it back as uint16,
Which means you should be using V_INT() instead of V_BSTR() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Your BSTR is bad. It doesn't really point to a BSTR.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Does anyone know where to find online beginner´s tutorial for TAPI? I just need simple things like how to make or receive a call.
|
|
|
|
|
Google is your friend.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
dart13 wrote:
Does anyone know where to find online beginner´s tutorial for TAPI? I just need simple things like how to make or receive a call.
The samples at JulMar[^] are useful learning aids.
The platform SDK samples are useful too as is MSDN. Especially this one[^]
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
thanks for your input. I'm very greatful.
|
|
|
|
|
I have completed a very important project. I did in VC++ and uploaded to Linux server. After then, I have re-compiled my work (without errors) and run it. It wrotes Segmentation fault, but when i checked output file it is actually the one that i have intended to have. Code uses dynamic memory allocation, file read and write, and 9 nestled for loops. Moreover I have uploaded two more projects and they were working without giving the segmentation fault. Another interesting subject about the code is that it writes values to the file at the end.
If you have experienced something like this please send your comments.
Deadline for the project is by tommorrow night (15th April). However comments after that time will still be useful.
May the bug killer be with you...
Cem Kalyoncu
|
|
|
|
|
Sorry, but 99.999999% of the time, the problem is with your code, not with the compiler.
And without seeing the code, we can't have a clue about why it's failing...
I see dumb people
|
|
|
|
|
... are you trying to run a Win32 executable on a linux OS ? ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
no.. I have recompiled it using g++.
May the bug killer be with you...
Cem Kalyoncu
|
|
|
|
|
ok ... so ... probable errors, bad initializations of variable, bad allocation, bad error checking ...
be sure to initialize everything, check all pointers, ... and build in debug and trace on linux ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Unix 'segmentation fault' is much the same as Windows' 'access violation'. It's caused by trying to read or write through a bad pointer, or by trying to jump to a bad location.
Usually this means that you're trying to read or write off the end of a buffer, or you're not checking the return value of one or more functions for errors before using that value (where the function returns a pointer, e.g. fopen ). It can also be an uninitialised pointer.
Jumping to a bad location is much harder and usually requires an uninitialised function pointer.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks for all,
The answer is actually trying to access out of bounds of a variable - it should give access violation but in Windows it allocates a litle more space then you have requested (duplicates of four i guess). the proplem is with the read routine that seems nearly perfect, I found the error when I tried to free the variable. It actually gave me error at that time (before I forgot to free them ). It is very interesting not to get an error on Windows.
As Mike said it is actually Access Violation.
Thanks for all
May the bug killer be with you...
Cem Kalyoncu
|
|
|
|
|
is there any notification for system datechange ???
|
|
|
|
|
To find out your answer, I ran notepad, and parked it in a corner of the screen. I then ran Spy++
(from VC Tools menu) and monitored all messages to the notepad's top level window. When I changed
the date / time, windows broadcasts a WM_TIMECHANGE message...
To quote:
Windows 2000/XP: An application should not broadcast this message, because the system will broadcast this message when the application changes the system time.
Iain.
|
|
|
|
|
will this message be generaten whenever day changes normally. ie at midnight...
|
|
|
|
|
Anonymous wrote:
will this message be generaten whenever day changes normally. ie at midnight...
Uh, no. But you could always set a timer with a slow interval (e.g. every five minutes), and monitor
the date. If it changes between WM_TIMER messages, do your thing, else return.
OR
Use CreateWaitableTimer / SetWaitableTimer / WaitForMultipleEvents in a separate thread.
OR
I'm sure XP has a way of asking it to run your program at set times, but I can't remember it.
OR
A long list of other alternatives.
Iain.
|
|
|
|
|
...hi...
for a longer time I am looking unavailingly for a method to read out a directory with all files with an explicit extension.
can anybody help?!
thx.... tito
|
|
|
|
|
You can use the MFC class CFileFind , or the Win32 functions it wraps: ::FindFirstFile , ::FindNextFile
and ::FindClose .
Good luck!
Iain.
|
|
|
|
|
I'm trying to create a rounded box button (sorry bout my lack of knowledge bout MFC) and I followed this tutorial in creating a ownerdrawn button.
The results looks great but there's only one flaw, even my button is now not a box, on each corner of the button there's always a white/gray space to fill the area of a box.
I think is because the button area is always a box and it looks bad if I place my button on top of image/color. How can I eliminate the those spaces in the corner of my button.
Thkx
|
|
|
|
|
|
Hi
I am currently trying to display an image stored in memory to the screen. I store the image data (i.e. the pixel intensity values, obtained after some computation) in an array in the memory. Could someone tell me how I can display it?
I understand I can loop the SetPixel method of CPaintDC, but I noticed that it is quite slow, and the image appears not all at once. Can I use BitBlt to accomplish this?
|
|
|
|
|
You can construct dib and then use to paint the image on the screen.
|
|
|
|