|
Taken From MSDN :-
Just look for that function in MSDN.
Example<br />
<br />
extern CImageList* pmyImageList;<br />
extern CDC* pmyDC;<br />
<br />
int i, dx, cx, cy, nCount = pmyImageList->GetImageCount();<br />
HICON hIcon;<br />
<br />
::ImageList_GetIconSize(*pmyImageList, &cx, &cy);<br />
<br />
for (dx=0,i=0;i < nCount;i++)<br />
{<br />
hIcon = pmyImageList->ExtractIcon(i);<br />
<br />
pmyDC->DrawIcon(dx, 0, hIcon);<br />
dx += cx;<br />
}
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Ok, thank you very much, I will try this way!
Just my interest for these common things
|
|
|
|
|
Can someone compile this c file for me I tired for a few days with no success
and this is really important to me .
http://www.xs4all.nl/~itsme/projects/sources/other/zippw.c[^]
many of my other mates attempted also failed they said it need unix os
I appreciate it to the max.
-- modified at 0:34 Thursday 22nd June, 2006
|
|
|
|
|
Yes it does compile (win32 console app) with a few changes to the includes and a few typedefs (the changes amount to at most 6 lines). That said this is a forum for posting programming questions and not a compiling service.
|
|
|
|
|
lol cmon I have no where else to ask
|
|
|
|
|
I really cannot see what's wrong here:
for (curPart; curPart < totalParts; curPart++)<br />
{<br />
#ifdef MTXCMD<br />
printf("Reading part #%i... \n", curPart);<br />
#endif<br />
printf("C");<br />
<br />
iFileName = mtxJoinAddExt(fileName, curPart-1);<br />
<br />
<br />
iFile = fopen(iFileName, "wb");<br />
<br />
<br />
if (iFile == NULL)<br />
{<br />
_mtxSetErrorCode(MTX_ERROR_READFILE);<br />
_mtxSetErrorInfo(iFileName);<br />
return -1;<br />
}<br />
printf("Checkpoint!");
The "C" prints, but the "Checkpoint!" doesn't... And no, the fopen() didn't return false, because if I put the "C" printf() after the next line, it does not print! And mtxJoinAddExt() returns fine, I'm sure of that. Maybe a compiler error? (GCC 3.4.2)
Thanks!
\|/ Thrift Store Floppy Collection \|/
(Server currently down due to mainteneance, aka comp not detecting monitor and acting weird)
|
|
|
|
|
Maybe because your program exit before having printed the text ? Try to add a sleep after the print.
Cédric Moonen
Software developer
Charting control
-- modified at 2:25 Thursday 22nd June, 2006
BTW, if you use printf to debug your code, use your debugger instead, it is much more powerfull.
|
|
|
|
|
My guess is that mtxJoinAddExt corrupts the stack. Check it for array overrun.
I.e:
char ch[5];
strcpy(ch, "Hello");
|
|
|
|
|
char ch[5];<br />
strcpy(ch, "Hello");
What am I supposed to check with that? Should I printf(ch) ? Thanks both of you!
\|/ Thrift Store Floppy Collection \|/
(Server currently down due to mainteneance, aka comp not detecting monitor and acting weird)
|
|
|
|
|
Hello. I'm sorry for the delay, due to public holidays in Sweden.
What I wanted you to check is for buffer overruns, as in my example.
(Allocating 5 bytes and writing 6 bytes in it).
Such overruns usually corrupts the stack, and makes the return to the previous function "go bananas".
That's a common source of this kind of problems.
|
|
|
|
|
hi..I have the following problem..
Im doing a program that receives SMS and save it to file,the SMS format is received like this
+CMGR=2
+CMGR: "REC UNREAD","phone number",,"06/06/21,15:20:28+32"
SMS Test
OK
the first line is the command Ive typed to read SMS to char* buffer and the last line is the responce of the modem (that the operation is done)
now I want to save the SMS starting from "phone number" ending with SMS test ( the message itself).
how can I do that dynamiclly?
|
|
|
|
|
You can use Find(), and based on the index returned extract the string using CString::Right(), CString::Left(), CString::Mid()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
use find()..to find what ? Ive searched CString functions and find() return the first occurrence of char..saying that "\"" or "\," is what Im looking for find() wont work..so can you explain more how is that done?
what about string tokenizer ..I dont know much about it but if I can tokenize the string it will be good..but with library to use and how??
|
|
|
|
|
CString s="+CMGR=2+CMGR: \"REC UNREAD\",\"phone number\",,\"06/06/21,15:20:28+32\"SMS Test OK";
int iFirstComma=s.Find (",",0);
CString sExtracted1=s.Right(s.GetLength ()-iFirstComma-1);
int j=sExtracted1.Find ("OK",0);
CString sExtracted2=sExtracted1 .Left (j);
Now sExtracted2 has the string you need. Is it Ok?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
My compiler(borland c++ builder 6) cant recognize CString class..the header file name is CString isnt it?maybe because its MFC.......but c++ builder has MFC !!
but this code looks fine..I'll try to implement it using other string type... thanks alot
|
|
|
|
|
..If there is "OK" in the SMS message itself the code above will trim the rest of the message...
its better to delete the last 2(or 3) characters...
|
|
|
|
|
For articles on String Tokenizing search CodeProject with String Tokenizing in the search box.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
A camera and a frame grabber have been set up. And the frame grabber has been installed in PCI. When I use continuous grab mode, the image data are written into a specified memory continuously and cover the old data. Then how can I update the image from the memory to the client screen since I have tried calling StretchDIBits in OnDraw(), but I find it is not efficient with the client area twinkling frequently. Is there any efficient way like copying the data directly to the display memory? How?
Thanks
|
|
|
|
|
Override OnEraseBackground to do nothing.
|
|
|
|
|
For this kind of application DirectDraw is the best solution,
With DirectDraw;
Less PCI bandwith consumption.
You can manipulate video memory directly in various video format.
You can solve flickering/twinkling by Double Buffering, Waiting Vertical SYNC.
|
|
|
|
|
In PPC emulator, I press a button to call a dialog. And in the dialog state, how can I hide the menu bar??
I use the following function in OnInitDialog()
this->ShowWindow(SW_HIDE);
or
this->SetMenu(NULL);
but they are useless@@
Any suggestion is useful!!
|
|
|
|
|
I have an application that uses the IProgressDialog interface to dislay a progress dialog during long processing steps. Everything works fine until I invoke the StopProgressDialog method to close the dialog. The progress dialog doesn't disappear until I move the mouse over it. Does anyone know what could be causing this?
|
|
|
|
|
Did you ever figure out the solution? I am having the exact same issue.
|
|
|
|
|
It's been a while since I had this problem but I believe what we ended up doing was to get the window handle of the dialog and force it down. I no longer have access to the code but if I can find out from a person who's still working on the project I'll try to post the code we used.
|
|
|
|
|
After searching the internet some more I found the same answer. Following is the code, in case anyone else has this issue.
HWND hDlgWnd(NULL);
HRESULT hr;
IOleWindow *pOleWindow;
//Sometimes the progress dialog sticks around after stopping it,
//until the mouse pointer is moved over it or some other triggers.
//This process finds the hwnd of the progress dialog and hides it
//immediately.
if (SUCCEEDED(m_pprogressdlg->QueryInterface(IID_IOleWindow, reinterpret_cast<lpvoid> (&pOleWindow))))
{
hr = pOleWindow->GetWindow(&hDlgWnd);
if(FAILED(hr))
{
hDlgWnd = NULL;
}
pOleWindow->Release();
}
m_pprogressdlg->StopProgressDialog();
if (hDlgWnd)
::ShowWindow(hDlgWnd, SW_HIDE);
m_pprogressdlg.Release();
|
|
|
|