|
They thanks to you both great help, will be able to graduate at university after all
[] /\ () X
|
|
|
|
|
I want to have a scroll-bar, I want it to have a non-client area (I draw a nice frame around it).
I override OnNCCalcSize/OnNCPaint , I calculate and draw my nice border but Windows-XP overwrites parts of it with the blue Vertical/Horizontal Scroll-Bars.
I've tried
<br />
InitializeFlatSB(this->m_hWnd);<br />
FlatSB_EnableScrollBar(this->m_hWnd, SB_BOTH, ESB_DISABLE_BOTH);<br />
FlatSB_ShowScrollBar(this->m_hWnd, SB_BOTH, ESB_DISABLE_BOTH);<br />
but it doesn't help.
Has anybody stumbled upon this problem ? In Windows-2000 my message-overriding prevents Windows from repainting it's scroll-bar, but under XP it somehow manages to get it in and mess-up my border
thanks
|
|
|
|
|
Im trying to print a VARIANT value to the screen using this code
TCHAR sz[MAX_PATH];
VARIANT vVal;
wprintf(sz, TEXT("Load Percentage: %s\n"), V_BSTR(&vVal));
wprintf(sz);
This builds ok, but doesnt print anything to the screen
If I use printf(sz) then I get a missmatch in variable types.
error C2664: 'printf' : cannot convert parameter 1 from 'TCHAR [260]' to 'const char *'
Anyone got any ideas on what I can do
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
roadragedave wrote:
If I use printf(sz) then I get a missmatch in variable types
printf("%s",sz); rite ???
|
|
|
|
|
Very true, I am an idiot,
BUT!, when I do that I get a strange output
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
I have never seen these characters before
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
Use _tprintf instead
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
How about:
wsprintf(sz, TEXT("Load Percentage: %s\n"), V_BSTR(&vVal)); or
wprintf(TEXT("Load Percentage: %s\n"), V_BSTR(&vVal));
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Hmmm, this code snippet works for me:
TCHAR sz[MAX_PATH];
VARIANT vVal;
vVal.vt = VT_BSTR;
vVal.bstrVal = SysAllocString(_T("95%"));
wsprintf(sz, _T("Load Percentage: %s\n"), V_BSTR(&vVal));
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Very nice,
What my problem is, is that I am calling a function called GetProperty
hRes = WmiTest.GetProperty(accClass, accProperty, accKey, &vVal);
vVal, which is VARIANT, has the property value which I want to display, so how do I do this?
Im sorry for being a pest on this one, thanks for your help
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
I finally got it, it was so simple in the end, I was getting an exception because I was trying to pass a uint16 to a string. For future reference if anyone has this problem
wsprintf(sz, _T("Load Percentage: %s\n"), V_BSTR(&vVal));
should be
wsprintf(sz, _T("Load Percentage: %i\n"), V_BSTR(&vVal));
Can you spot the simple difference
Thanks for all yer help everyone
We have a mathematician, a different kind of mathematician.............. and a statistician!
|
|
|
|
|
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
|
|
|
|