|
My code is working fine when I manually start/stop the service.
The problem I facing is my service didn't signal stop event when i restart/shutdown my pc.
I am using CNTService code from PJ naughter
|
|
|
|
|
Hi All,
I am trying to save the clipboard content as a bmp file. I tried like this:
<br />
HANDLE hBmp;<br />
OpenClipboard();<br />
hBmp = GetClipboardData(CF_DIB); <br />
if(hBmp)<br />
{<br />
if (WriteDIB("c:\\TEST.BMP",GetClipboardData(CF_DIB)) == TRUE)<br />
{<br />
MessageBox("Success","BMP Written",NULL); <br />
}<br />
else<br />
{<br />
MessageBox("Failed","BMP Write",NULL);<br />
}<br />
EmptyClipboard ();<br />
}<br />
else<br />
{<br />
printerror(GetLastError());<br />
}<br />
CloseClipboard(); <br />
<br />
<br />
void printerror(long err)<br />
{<br />
LPVOID lpMsgBuf;<br />
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORM<br />
AT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSER<br />
TS,NULL,err,MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(LPTSTR)&lpMsgBuf,30,NULL);<br />
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION ); <br />
}<br />
I am getting NULL in hBmp. So if condition fails. I tried to get the error code. But error message says "Function completed successfully". Can anyone help me where i went wrong??
Thanks in advance,
Thoppae.
Its Always the Root that helps to Nurture Fruits.The Root is 'C'.
|
|
|
|
|
when i want to insert 5000-7000 items to a listctrl.
it's inserting process is very slow. how to deal with that?
3x. and anyother Q: when i use CListBox to SetCurSel(5000),or lager number it will also slow. how to do?
love program
|
|
|
|
|
For a good solution take a look at Chris Maunder article "Using text callbacks in ListView Controls"
bye,
CC.
|
|
|
|
|
Call "LockWindowUpdate" before bulk insertion and "UnlockWindowUpdate" after.
m_wndListCtrl.LockWindowUpdate();
m_wndListCtrl.UnlockWindowUpdate();
|
|
|
|
|
Hi All,
I am using a property sheet..i have created three property pages nad added them to the propert sheet. This property sheet is made visible when user clicks on the system Tray icon. One of the property page is displaying a web page is webbrowser control. Everything works fine for some time..then..it automatically either stops listening to right click event of mouse or even deletes one or more of the tabs..also sometimes it closes visual studio...can anyone help me out to sort out this problem..thanks a lot in advance for any help...
regards
Himanshu
|
|
|
|
|
With one of my applications using property sheets, I discovered that you cannot update page fields unless the property page is visible - just update the information and then update the form in OnShowWindow(). Also, you cannot have an active timer for a property page that is not visible. In both cases, if the property page is not visible, the window handle is not valid and all sorts of unusual behavior happens.
Steve
|
|
|
|
|
SOCKADDR_IN tempaddr;
tempaddr.sin_addr = INADDR_ANY;
I have seen code like this in many examples. I am not quite sure why the compiler would tell me that:
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'unsigned long' (or there is no acceptable conversion)
I would have never gotten as far as I did with this program without all of your help.
Thank you
|
|
|
|
|
The compiler is telling you that, there is a type mismatch. The "sin_addr" is a structure. Read the MSDN about it. (In my humble opinion: you got to dig deeper in programming )
Try this @ home. (B&B)
|
|
|
|
|
Try this:
tempaddr.sin_addr.s_addr = INADDR_ANY;
In your example, you are trying to assign a single value to a structure.
Steve
|
|
|
|
|
Can any one help me? Please...
|
|
|
|
|
Hi,
I am having problem retriving system device icons, i know there is a function in ddk that allows you to do just that, however i am not sure if i am using it correctly. Can anyone check what is wrong with the function below thanks... or can anyone suggest any other ways of retriving system device icons.. thanks....
int DeviceView::GetClassImage(HIMAGELIST& imagelist)
{
_SP_CLASSIMAGELIST_DATA *classlist = new _SP_CLASSIMAGELIST_DATA;
classlist->cbSize = (BYTE)sizeof(PSP_CLASSIMAGELIST_DATA);
if (!SetupDiGetClassImageList(classlist))
{
return false;
}
imagelist = classlist->ImageList;
delete classlist;
return true;
}
|
|
|
|
|
classlist->cbSize = sizeof(_SP_CLASSIMAGELIST_DATA);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Is there anyway to list 10 recently access files(MRU)
instead of 4?
Thanks
Shin
|
|
|
|
|
Call this function from within the InitInstance member:
LoadStdProfileSettings(10);
where 10 is the nr. of most recently used (MRU) files.
bye,
CC.
|
|
|
|
|
I didn't know it was so easy.
Thanks for your help.
Shin
|
|
|
|
|
Friends,
I want to initiate a dialog box from parent window. But i want to initiate this dialog just like a "child window" and not a dialog.
I mean, that there are two types of dialogs, modal and modeless. Modal dialogs bolcks the parent window, so i don't want my dialog to be modal. So i create modeless dialog. But the problem is that modeless dialog is also tightly coupled with parent window and when i minimize parent window, the modeless dialog also gets minimized.
I want the dialog to be completely "independent" from its parent window. How can i do so ??
|
|
|
|
|
If you create the dialog so it has no parent (i.e parent = NULL), it shouldn't tie itself to the parent window (because there isn't one)
Phil
|
|
|
|
|
Not true...from the MFC CDialog class docs for Create()...
For either form, pass a pointer to the parent window object. If pParentWnd is NULL, the dialog box will be created with its parent or owner window set to the main application window.<br />
Steve
|
|
|
|
|
My bad. Goes to show how much I've used MFC lately.
Perhaps a call to SetParent or SetOwner after creation may help?
|
|
|
|
|
Hi, just the part of a program that doesn't work, this is the part that is causing trouble. I tried to compile in VC++, Thanks:
#include <stdio.h>
#include <stdlib.h>
struct listNode {
char data;
struct listNode *nextPtr;
};
typedef struct listNode LISTNODE;
typedef LISTNODE *LISTNODEPTR;
main(){
LISTNODEPTR newPtr;
//I get an error here!!!
newPtr = malloc(sizeof(LISTNODE));
return 0;
}
|
|
|
|
|
To much time lost:
newPtr = (POINTNODE *) malloc( sizeof(POINTNODE) );
|
|
|
|
|
That too.
If your nose runs and your feet smell, then you're built upside down.
|
|
|
|
|
Your sig is offensive to people with runny noses and smelly feet and you might want to consider changing it
|
|
|
|
|
Your includes at the top got cut off, probably because it interpreted < and > as HTML (hint: use < and > for angle brackets)
I suspect you don't have the right file included for malloc . You need to include stdlib.h and malloc.h.
Note: if your program is C++, though, you can use new instead of malloc and it is much easier. e.g.,
newPtr = new LISTNODE;
If your nose runs and your feet smell, then you're built upside down.
|
|
|
|