|
using WinExec you should call "C:\WINNT\system32\mmc.exe C:\WINNT\system32\devmgmt.msc".
Don't try it, just do it!
|
|
|
|
|
ShellExecute(NULL,"open","devmgmt.msc",NULL,NULL,SW_SHOW);
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
hello everybody,
I need to write kind of scheduler. It will trigger an event every day at 00:00,
00:30, 08:00, 08:30, 16:00 and 16:30.
Can anybody show me a way how to do it in MFC?
Thanks,
Muharrem
|
|
|
|
|
MFC or not, using the ITaskScheduler and ITask interfaces is the easiest way.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have an app that uses a dll. I will be launching two copies of this app simultaneously. This app uses a dll (no mfc in it). I had made this a win32 dll and didnt see anything about linking options. The way I use this dll is through including the h file, putting the dll in the exe folder and linking in the .lib file through project settings. However I think I am having trouble because I want each copy of the exe to have its own copy of the dll (there are static variables in the dll), and I suspect that its actually being shared and I have only one copy being used by both exes . How do I arange things so that each exe can have its own copy of the dll? My dll functions look like:
Q20_API int Ainit(init_params * params);
This name was generated by the appwizard when i made the win32 dll project.
Thanks,
sb
|
|
|
|
|
Hello,
I have a view. On my view I attached a dialog which has a menu. When I click on view, the dialog appears to be grayed, but when clicked on dialog it appears to be enabled. The same is the case with view, it appears to be grayed when clicked on dialog. Is there any way to make the dialog appear as enabled always irrespective of the focus on it?
can anyone please help me to solve this?
Thanks
Madhavi
|
|
|
|
|
Hello,
I would like to know from where I can download the header file "Wbemidl.h". I have tried, but could not find anywhere. Can anyone help me on the same?
Regards,
Mythri
|
|
|
|
|
It's included with the Windows SDK.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi
I suppose, you must install microsoft sdk for this. I can find this file on my ../microsoft sdk/include folder
Regards
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hello,
Can you send across that header file as an attachment to me?
Thanks and Regards,
Mythri
|
|
|
|
|
Woah, you need to change your thinking! NEVER download a header file. Headerfiles are always invluded in some package, and must be used with the package. It isn't unheard of for two headerfiles that appear the same on the surface to be differint in subtile ways.
Perhaps the header you are talking about is one you can get from anywhere, but how do you know. You should have asked what package included Wbemidl.h, and where do I get it. You should also include some background on what you are using it with, just in case two different packages have a header with the same name.
Perhaps that is what you ment, but it isn't what you asked!
|
|
|
|
|
I have this code:
static IDirectDrawSurface * CreateOffScreenSurface(IDirectDraw *pdd, int dx, int dy)
{
DDSURFACEDESC ddsd;
IDirectDrawSurface *pdds;
//
// create a DirectDrawSurface for this bitmap
//
ZeroMemory(&ddsd, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT |DDSD_WIDTH;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwWidth = dx;
ddsd.dwHeight = dy;
if(pdd->CreateSurface(&ddsd,&pdds,NULL)!=DD_OK)
I get an error :
error C2039: 'CreateSurface' : is not a member of 'IDirectDraw'
c:\program files\microsoft visual studio\vc98\include\ddraw.h(491) : see declaration of 'IDirectDraw'
And I cannot understand why I am getting this error, I have linked the project with ddraw.lib and included the ddraw.h.
when I click at the error line : see declaration of IDirectDraw it shows that CreateSurface is a member function, but why doesn´t the compiler think so???
And when I print pdd->.... it shows a list of the memberfunctions and CreateSurface is listed, so I just can´t see why I have this strange error.
I have the same error with the IDirectDrawSurface memberfunctions.
Does anyone have a clue? I am totally lost.... Thanks for your help, regards Dani
|
|
|
|
|
1. DirectDraw if out-of-date.
2. Maybe your header file is too old (use directx sdk files)
Don't try it, just do it!
|
|
|
|
|
I tried to change the link path to c:\dxsdk\include\, but the problem still exists, when I click on the error it opens the ddraw.h and show this:
/*
* IDirectDraw
*/
#if defined( _WIN32 ) && !defined( _NO_COM )
#undef INTERFACE
#define INTERFACE IDirectDraw
DECLARE_INTERFACE_( IDirectDraw, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectDraw methods ***/
STDMETHOD(Compact)(THIS) PURE;
STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
Can there be another problem?
Please help, cheers Dani
|
|
|
|
|
Hi All,
I am trying to disable the minimize & maximize button in a dialog based application. The close button get's disable, but the other two are not disabled. The code i am using is
CMenu* pSM = GetSystemMenu(FALSE);
if(pSM)
{
pSM->EnableMenuItem(SC_CLOSE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED);
pSM->EnableMenuItem(SC_MAXIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED);
pSM->EnableMenuItem(SC_MINIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED);
}
i am adding this code on OnInitDialog.
Thanx in Advance
Sujan
|
|
|
|
|
Can you not just remove the WS_MINIMIZEBOX and WS_MAXIMIZEBOX styles from the dialog template?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have a list control in report view mode.
I'm trying to highlight rows based on what info they have.
Highlighted ones have the text color set to red, non-highlighted gets black.
What I have (pseudocode) is this:
<br />
for (int i = 0; i<numEntries; i++) {<br />
color = function_to_check_info_and_return_COLORREF(info);<br />
myList.SetTextColor(color);<br />
myList.InsertItem(etc);<br />
myList.SetItemText(blah, 1, value);<br />
.<br />
.<br />
.<br />
myList.SetItemText(blah, 5, value);<br />
}<br />
Assume my function to get the COLORREF works as planned (it does, it's been checked by 2 other software engineers. They have no idea why this won't work either).
Would you agree that bit of code should set the text color for each row in the report based on the return value of the COLORREF function?
Well, it doesn't.
What actually happens is that all the items are added to the list, and then MFC applies the last returned COLORREF to all items in the list. What?!
I had the app open on one monitor while stepping through it on the other, and the list control only shows the items once they've all been added.
HOWEVER, the scrollbar appears and resizes as each item is added. So while the list is populating, the scrollbar reflects what should be in it, but it has no contents. Bizzare.
To try and force it to update as it should, I added:
<br />
myList.SetRedraw(TRUE);<br />
myList.Invalidate(TRUE);<br />
Here is a direct quote from MSDN as to what SetRedraw does:
Updating a control or window with large amounts of data may cause flicker. In such cases it may be better to turn off drawing. While the redraw flag is cleared, the contents will not be updated after each change and will not be repainted until the redraw flag is set.
In other words, setting the redraw flag to true should mean the list control updates each time something is inserted. Not so. It appears both of those statements are simply ignored.
Only once have I been able to get it to do what I want, under very specific conditions. If:
* I call myList.SetColumnWidth(someCol, LVSCW_AUTOSIZE);
and
* The data width in someCol requires the column to be resized
THEN it will work.
Obviously this is useless, as it requires each entry in someCol to be longer than the last in order to get the desired effect.
Just to prove to myself I wasn't going mad and that you CAN use settextcolor for individual entries in the list, I added a button which, when clicked, inserts an item into the list in green. It works fine (and the rest of the list stays in the color it was).
So, in conclusion:
What's going on? Am I trying to make it do something it can't or what?
I have spent all morning looking at this thing, tracing, stepping, setting breakpoints, setting watch variables, and its ABSOLUTELY FINE in terms of program flow.
Everything gets set when it should be set.
Everything is called in the correct order.
Either I've misunderstoon the purpose/functionality of settextcolor or MFC has decided to set the color when it feels like it, not when I ask it to.
If anyone has any ideas I'll be very grateful!
|
|
|
|
|
m_dale wrote:
Would you agree that bit of code should set the text color for each row in the report based on the return value of the COLORREF function?
Well..no! The SetTextColor() / SetBkColor() functions applies to the entire control, not just to an individual item within.
If you require individual control over the color and/or fonts used by row and column then have a look at Custom Drawing techniques. This[^] is a good starting article.
m_dale wrote:
Just to prove to myself I wasn't going mad and that you CAN use settextcolor for individual entries in the list, I added a button which, when clicked, inserts an item into the list in green. It works fine (and the rest of the list stays in the color it was).
Beats me This should not happen, but see below:
m_dale wrote:
I had the app open on one monitor while stepping through it on the other, and the list control only shows the items once they've all been added.
Makes sense as the drawing routine would not have been called while tracing through your code.
m_dale wrote:
In other words, setting the redraw flag to true should mean the list control updates each time something is inserted. Not so. It appears both of those statements are simply ignored.
Although I cannot be sure, I would guess that while you are in debugging mode, the usual process of pumping and processing the usual windows messages (that are responsible for your control window updates), are in stasis; therefore you cannot expect normal window actions to be performed while this is happening.
m_dale wrote:
Only once have I been able to get it to do what I want, under very specific conditions. If:
* I call myList.SetColumnWidth(someCol, LVSCW_AUTOSIZE);
and
* The data width in someCol requires the column to be resized
THEN it will work.
Obviously this is useless, as it requires each entry in someCol to be longer than the last in order to get the desired effect.
As I said above, once the window has been allowed to process its usual messages, then you will get the results you expect, but while tracing through your frozen program, one line at a time, this is expected.
I Dream of Absolute Zero
|
|
|
|
|
Ah, looks like i was being stupid.
When I drag another window over my funky multicolored list it redraws in the last color selected.
Custom drawing here I come...
|
|
|
|
|
Hello everybody, I'am a beginner using GDI+ and I want to know how to draw a gray level image, having only de size of the image and an array with the gray values of the image
thanks everybody
Frida Vega
|
|
|
|
|
Dear :
I need information for how to make ISAPI redirection filter in c++, i used to make redirection using MFC ISAPI Filter class like this : in OnUrlMap function
[CODE]
char chHeader[1024] ;
sprintf(chHeader,"Location:%s\r\n","/Error.htm");
DWORD dwchHeader = sizeof(chHeader);
pCtxt->ServerSupportFunction(SF_REQ_SEND_RESPONSE_HEADER,"302 Object Moved",(LPDWORD)chHeader,NULL);
return SF_STATUS_REQ_FINISHED_KEEP_CONN;
[/CODE]
but sometime this does not work, I mean it wont redirect (is above code not correct?) ,if so I need a methods to how redirect to other URL permanently other than above method.
Regards
|
|
|
|
|
Is it possible to detect if a mmodem is currently connected/ in use etc.
If so how?
Steve
|
|
|
|
|
|
Thanks for your prompt reply.
I'm not sure if that's what I want really.
What I really want my app to do, is watch the modem for a remote connection (company dialling in), then when it sees a connection, to disable the LAN.
Obviously when they disconnect to re-enable the LAN.
Thanks
Steve
|
|
|
|
|
Does anyone know how to go about disabling a network adapter.
I just want to do want your able to do if you right click on you network connection in the tray.
Steve
|
|
|
|
|