|
There are two projects each with their own resources (MIM.rc and MCB.rc) In the MCB_Library there is a MCB.res file. how do I ensure that this is properly linked to the MIM executable ?
Thank you for being patient with a MFC newbie...
liobsynde
|
|
|
|
|
i am not sure this will work or not, but can you try providing the .res file in the link tab of project settings ?
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
It didn't work. It doesn't like having an additional res file specified.
The creator of the MCB project is going pull out the resources for the two dialog boxes that I need so that I can include just those resources. And try from that angle.
Thank you for your help/ideas.
liobsynde
--Wish I had something great to say here, but the good ones have already been taken...
|
|
|
|
|
Sorry that i could not be of much help.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Ideally, the data processing library (MCB_Library ) shouldn't contain any GUI calls. If there's a need for MCB_Library to get information from the client application at run-time, you might want to make MCB_Library call into its client and execute a known data retrieval method.
For example, define an interface (an abstract base class with a single pure virtual method) called IMCB_Client .
class IMCB_Client
{
public:
IMCB_Client() {};
virtual ~IMCB_Client() {};
public:
virtual bool getDataFromUser
(void* pData) = 0;
} Your MIM application should "implement" the interface (by simply multiply inheriting from IMCB_Client ), like so:
class CMimApp : public CWinApp,
public IMCB_Client()
{
...
public:
bool getDataFromUser
(void* pData);
} The implementation of CMimApp::getDataFromUser() should display the appropriate dialog and store the desired information in pData . The method could return false to indicate the data is not available. CMimApp should register itself as a client of MCB_Library . This just means storing a pointer to CMimApp in MCB_Library .
Finally, replace your call to display the dialog in MCB_Library with this code:
ASSERT (m_pClient != NULL);
DATA someData;
bool bGotData = m_pClient->getDataFromUser (&someData);
if (bGotData)
...
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I want to shut down my computer at a certain time of the day, so I wrote a small program that calls InitiateSystemShutdownEx() and scheduled it using the Task Scheduler. The program works whenever I'm logged in on my computer. However when I'm logged off (i.e. the computer displays the welcome or logon screen), the shutdown doesn't occur. The scheduler does show that the program was executed, so I'm guessing it might have something to do with security.
Here's a section of the code:
if (!mode)
{<br />
HANDLE procHnd, tokHnd;<br />
<br />
procHnd = GetCurrentProcess();<br />
if (!OpenProcessToken(procHnd,TOKEN_ADJUST_PRIVILEGES,&tokHnd))<br />
return;<br />
<br />
TOKEN_PRIVILEGES tp;<br />
LUID luid;<br />
<br />
if (!LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &luid))<br />
return; <br />
<br />
tp.PrivilegeCount = 1;<br />
tp.Privileges[0].Luid = luid;<br />
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;<br />
<br />
AdjustTokenPrivileges(tokHnd, FALSE, &tp, 0, NULL, 0); <br />
<br />
InitiateSystemShutdownEx(NULL, NULL, 15, TRUE, FALSE, SHTDN_REASON_FLAG_PLANNED);<br />
<br />
}<br />
else if (mode == 1)
SetSuspendState(FALSE,TRUE,FALSE);<br />
else if (mode == 2)
SetSuspendState(TRUE,TRUE,FALSE);
I tried using ExitWindowsEx() but have the same problem. However, hibernating does work when I'm logged off.
I'm puzzled
reymano
|
|
|
|
|
Are you sure that you used these flags with ExitWindowsEx
1. EWX_FORCE
2. EWX_FORCEIFHUNG
As it works on my PC
...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
Yep, I tried them but no go. Does your program work when you are logged off? Try scheduling the program a minute or two into the future, then logoff and wait on the welcome screen to see if it shuts down.
FYI, I'm also running on WinXP Pro if that makes a difference.
reymano
|
|
|
|
|
if this question has been asked before or answered somewhere else just point me there. anyway I was wondering how I can make a fullscreen, transparent OpenGL window so I could draw 3D objects on my desktop. I mainly want it so I can use Cg shaders and play with my desktop. the only catch is i want the effects to stay under the icons but effects my wallpaper. I want to use my desktop while the effect is going on. does that make sense?
thanks ahead of time.
|
|
|
|
|
Folks,
I am really hoping you can help me with this because I have no idea what it means. I have just installed embedded Visual C++ 4.0 w/ SP3, SQL Server CE 2.0, and emulation images for Windows Mobile 2003 second edition on two computers. One is a laptop and the other is a desktop running Windows 2000 with the latest patches. It has an AMD 64 bit CPU and SATA drives. On the laptop, everything works fine, but on the desktop, when I try to compile anything, I get a message box labeled "cl.exe - No Disk" and the message "There is no disk in the drive. Please insert a disk into drive \Device\Hardisk3\DR7".
I have googled for this message and searched msdn but can't find anything relevant. Any assistance would be MUCH appreciated.
I have posted this also in the Embedded/Mobile board and apologize for the double posting, but I'm not at all sure the problem is specific to eVC.
Regards,
Matthew Fleming
|
|
|
|
|
In Tools -> Options, you can go to the Directories tab and see where it's looking for things. If there are duplicate paths that don't exist anymore then you can just delete them from there and you'll have no problem anymore.
|
|
|
|
|
My problem is this : I want an event when the user stops resizing the window by using the mouse by means of dragging:
a) if the user hasn't finished dragging the margins : do nothing
b) when the user released the drag and drop mouse : Resize the controls in the window
The windows I'm using are MDIChildFrame
I tried overwriting OnSize(WM_SIZE) but gets called only when it's maximized or minimized not for dragging
I tried overwriting WM_SIZING in Window proc but gets called continuosly when user is dragging. so difficult to Resize the controls...flickering problem
So i want to know is there any event that can be captured once the dragging of mouse is over?????
can some one help me ....very urgent.....
Adi
Software Engineer
|
|
|
|
|
Hmm, I think you'll need to keep track of a WM_LBUTTONDOWN and handle WM_SIZE if a corresponding WM_LBUTTONUP has been received. You should probably also handle WM_KILLFOCUS in order to reset the mouse-down state.
Just to make sure I've interpreted your question correctly, you only want to control window resizing if the mouse was used, right?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Handle WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE to know when a resize or move operations begins and ends. When you get WM_ENTERSIZEMOVE , save the window's RECT . When you get WM_EXITSIZEMOVE , get the new RECT and if it's different, move your controls around.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"die"
ahhhh!
"diet"
AAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!
|
|
|
|
|
thanku very much Ravi and Michel.
i tried wht michel was telling... it's working fine.
thanks again...
Adi
|
|
|
|
|
Hi all,
Could anyone show me an implementation of ICopyHook Interface and CopyCallBack Function.?
Where can i find free source code or project for this purpose.?
Thanks a lot.
|
|
|
|
|
how can I hide my VC++ application from task list
is there any API?
any example will do!
|
|
|
|
|
are you lokin for ShowWindow(hWnd,SW_HIDE);
greatest thing is to do wot others think you cant suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
Suhredayan P wrote:
ShowWindow(hWnd,SW_HIDE);
it will hide the window too.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
I want that my running exe should not be visible in the task manager list, is ther a way
|
|
|
|
|
there is no harm being in the task managers list unless you are writing a crook program.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Yes I do want to write a spy application, which the users should not aware that it is running when pressed CTRL+ALT+DEL to see the list of running programs, where my running application should be invisible
|
|
|
|
|
instead of hinding your application from the task manager (something i doubt you can do) you can give some name that looks like some windows service
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Task Manager's Applications tab does not actually show applications—it shows the captions of visible, top-level windows .The Task Manager builds this list by walking through all of the top-level windows in the system (using something like EnumWindows), and adds to the list the windows that have the WS_VISIBLE style bit turned on.
greatest thing is to do wot others think you cant suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
I think you are confused with Spy++
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|