|
vikrams wrote:
"%I64d" I never saw this as a parameter
try using "%i" or "%l"??
The parameters are somewhere on MSDN although hard to find (like everything on MSDN )
Hope this helps!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Actually I have to store 12 digit decimal number...so __int64 is the only option remains... and I want to print it in buffer..
|
|
|
|
|
Well I found something like "%I64" so maybe just the "d" is to many?
Maybe you can divide it in 2x32bit integers? and write it like that?
Look on fprintf in MSDN there you'll find some % values for string formatting.
If this fails I'm sorry to say I'm out of ideas.
Good luck to you.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
HI
I used Function swprintf and it works..it's unicode version of sprintf.
VS
|
|
|
|
|
%I64d is a valid format string. However, it is not supported by either version of wsprintf() . You'll need to use sprintf() instead.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am trying to set the thread function and get compile errors:
Here are the relevant pieces:
unsigned int _stdcall CCad::RunAlgThread(void*);
and
int SetFunc(unsigned int (_stdcall *pFunc)(void*) = 0);
so I do:
m_thread.SetFunc(RunAlgThread);
the compiler error:
error C2664: 'SetFunc' : cannot convert parameter 1 from 'unsigned int (void *)' to 'unsigned int (__stdcall *)(void *)'
What needs to be done to fix this?
Thanks,
sb
|
|
|
|
|
Just declare your member function as static
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Papa has told you how to fix the problem. If you want to know why the problem exists, read this article. Non-static member functions have an implied 'this' pointer as the last parameter (this is what the compiler was complaining about). Static member functions do not have the 'this' pointer.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Could I trouble you to type out the link? I cant seem to get to it by clicking on "this". Appreciate it,
sb
|
|
|
|
|
http://www.codeproject.com/threads/memberthread.asp
(you can find it by right clicking and choosing view source
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Do you normally have troubles with hyperlinks in the CP forums? Can you right-click on it and select "Open in New Window" from the context menu?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Only at work. Even to get to CP I have to use 209.171.52.99 and navigating within cp is a nightmare too. Some problem only occurring with the cp site here.
|
|
|
|
|
I want to create an app with three CView derived classes similar to the default Visual C++ IDE ( I don't need complicated things like MDI's or tabbed controls or docking just yet). Is is necessary to create a static CSplitterWnd within another and can anybody give me any starters?
Thanks,
John
|
|
|
|
|
Worked this one out. I added a new class derived from CFrameWnd and put that inside the initial SplitterWindow. Then I had a second splitter inside the the CFrameWnd.
|
|
|
|
|
I’m going to create a shape-class containing a lot of flat polygon areas.
I will make it possible to subtract one shape from another and then I need an algorithm to se if two polygon-areas in the 3D-space crosses each other, and if in which line the crossing is.
I see there should bee some kind of linear algebra calculations but I do not really know how to start constructing my c++ shape classes.
_____________________________
...and justice for all
APe
|
|
|
|
|
Well, hail there again.
Why don't you stick to one thread?
Anyway, you sholdn't be a math "expert" to solve this one, but you have to know basics of geometry at least.
I'll give you solution for intersection bitween line and plane, the rest you can do yourself.
We have three points and a normal vector (N). The equation of a plane is Ax+By+Cz+D=0.
We have two points P1 and P2. The equation of a line is P(t)=P1+t*Pd where Pd=(P2-P1), t>0.
To determine if there is an intersection with the plane, substitute for P(t) into the plane equation and get A(P1x+t*Pdx)+B(P1y+t*Pdy)+C(P1z+t*Pdz)+D=0, which yields t = -(Dot(N,P1)+D)/Dot(N,Pd). Now find divisor Vd=Dot(N, Pd), if Vd=0 then the line is parallel to the plane and if Vd>0 then the normal N of the plane is pointing away from the ray (that can be useful for one-sided faces). Now we can find t, if t<0 then the line intersects the plane behind origin, i.e. no intersection of interest, otherwise we can put t in the equation of a line to find intersection point.
Enjoy.
|
|
|
|
|
va`Lery wrote:
Why don't you stick to one thread?
Well no excuses. I Rebuilded the question…
I’m not bad at either math or c++ but it’s the thing hat implement the algostuff into code that, for me is difficult. Small problems with both of them (math and c++) makes things hard for me.
Thanks
_____________________________
...and justice for all
APe
|
|
|
|
|
hi,
i have a text in an "unknown text encoding" and I need to extract all non ascii charachters from it; replace them with some ascii tags; do some processing and then; replace the original non ascii chars back.
*(non ascii charachters like japanese and chinese charachter sets)
well basically i have a vrml scenegraph and i need to render it using the open inventor renderer, which has problems with non ASCII charachters. so I am doing this ..
get the sceneData in memory as binary data
void *sceneData=<scenedata from="" file=""> ; scenedata(sizeof(filesize));
then read each BYTE from memory buffer;
check the ASCII value to each BYTE;
if outside ASCII range -> then replace it with a TAG.
ELSE copy as such;
NOW is this check a correct way to do it .. i mean do both the bytes of the multibyte charachters need to be outside the ASCII range ???
is there a better alternative way than this HACK !! please suggest !!
i am totally stuck
|
|
|
|
|
Well, my suggestion will be to forget about bytes and treat each character as unsigned short (WORD). In this case your character isn't ASCII if value bigger than 255 (or 127 if you want only latin chars).
|
|
|
|
|
How to Enumerate threads in Process?
(I need ausing it to enumarete windows create by some process,
using than EnumThreadWindows() )
I did not found such an API method...
Help please..
Or if sample exist - please provide link.
thanks.
|
|
|
|
|
use this little CODE
HANDLE SnapShot;<br />
PROCESSENTRY32 *ProcessList=new PROCESSENTRY32;<br />
<br />
<br />
SnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);<br />
if(SnapShot==INVALID_HANDLE_VALUE)<br />
{<br />
<br />
}<br />
<br />
<br />
if(Process32First(SnapShot, ProcessList) == FALSE) <br />
{<br />
<br />
CloseHandle(SnapShot);<br />
return FALSE;<br />
}<br />
<br />
<br />
while(1) {<br />
<br />
if(Process32Next(SnapShot, ProcessList) == FALSE) <br />
{<br />
<br />
if(GetLastError() != ERROR_NO_MORE_FILES) <br />
{<br />
<br />
CloseHandle(SnapShot);<br />
return TRUE;<br />
}<br />
else <br />
{<br />
CloseHandle(SnapShot);<br />
return TRUE;<br />
}<br />
}<br />
<br />
<br />
process.Add(ProcessList->szExeFile);<br />
PID.Add(ProcessList->th32ProcessID);<br />
<br />
}
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
See if this article is of any help.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is there such a code:
How to make screenShot to file...
Or how to save CBitmap,or hBitmap to file ?
(to BMP or JPG)
thanks.
|
|
|
|
|
use
KeyBD_Event() to Fire VK_SNAPSHOT (resemble PrtScr Button);
and Then COpy The BItMapDAta From using
OpenClipBoard and GetClipBoardData() api to get into HBITMAP HAndle
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I found direct way how to get BMP
from desctop, without emulation user.
How to save it so BMP or better to JPG, GIF ?
CBitmap::serialize() ?
It only saves BMP ?
|
|
|
|