|
BlitzPackage wrote:
It's driving me nuts. It just started doing this today.
Try 'clean' ( which erases your old compilation files ) and then 'rebuild all'. This shouldn't happen, but that's how you fix it. If that doesn't work, go into the directory you're building in, and delete everything by hand. Then the compiler has no choice but to recreate it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Why is it not seeing the IActiveDesktop Interface in shlobj.h. I tried using other interfaces in there, and they work fine, but the IActiveDesktop interfaces are the only ones that dont work.
When I try to compile the following code I get an error:
error C2065: 'IActiveDesktop' : undeclared identifier
#include <shlobj.h>
#include <string>
#include <wininet.h>
#include <windows.h>
#using <system.dll>
#using <mscorlib.dll>
using namespace System;
using namespace std;
int main()
{
HRESULT hr;
IActiveDesktop *pActiveDesktop;
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IActiveDesktop, (void**)&pActiveDesktop);
...
|
|
|
|
|
Include <wininet.h> before including <shlobj.h> and make sure _WIN32_IE is defined to a value greater or equal than 0x400
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thanks
now unfortunately the hr function
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IActiveDesktop, (void**)&pActiveDesktop);
is not setting up the ActiveDesktop and hr is returning failed,
how do i initialize it so that i can use pActiveDesktop?
|
|
|
|
|
Did you call CoInitialize ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Always look at the HRESULT value. Then do a look it up in the system header file called winerror.h . The header files are documented.
|
|
|
|
|
Carlisle Willard wrote:
error C2065: 'IActiveDesktop' : undeclared identifier
Here is example that use IActiveDesktop:-
http://www.codeproject.com/com/comintro.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I'm still struggling with this project, getting it to link to DCMTK. I want to change my MFC app from linking to the multithread dll to just multithread. However, I get this message:
Please use the /MD switch for _AFXDLL builds
I cannot find code that #defines _AFXDLL, or any thing else that would cause this to be defined. How do I change this ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Configuration Properties, General, "Use of MFC". Change it to "Use MFC in a Static Library"
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Brilliant, thanks. Just trying now...
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks - now I have another external library that won't link so I'm trying to rebuild it with /MT, but even if I change that setting, I get the same error. Do you have any idea why that might be ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can someone explain to me the basics of source code colorizing?
I want to add source colorizing to a CEdit control, but I only have a rought idea as to where to get started.
Can you explain the steps for colorizing C++ code for just:
1) Strings
2) Comments
3) Numbers
4) Keywords
If you don't wish to explain, but instead know of an article which explains the state machine/engine responsible for colorizing a source document I'd like to hear about it.
I AM NOT however asking to be referred to any of the CP articles such as CrystalEdit which serves as a good example as to how a colorizing engine might work.
I would like a more detailed explanation than just reading someone source code and learning from that.
I should also note, that I am not planning on using any parsing framework like Spirit, etc...
I want to code the colorizer by hand Just becuz
Cheers
It's frustrating being a genius and living the life of a moron!!!
-- modified at 19:47 Monday 29th August, 2005
|
|
|
|
|
If you don't want to use a parsing framework, then you need to write one. The most obvious place to start is to search for keywords. My first step would be to add the regex stuff from Boost, to make it easier to find those words.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I should have mentioned, this is for a CEdit control, so regex would probalby be too much.
Everytime a keystroke occurs a function is called which is passed the entire controls buffer (actually i'm changing that soon to only visible characters - which creates a problem on it's own )
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Hockey wrote:
should have mentioned, this is for a CEdit control, so regex would probalby be too much.
I dunno, maybe I've been spoiled by C#, but regardless of how it's being stored/displayed, I think regex is the nicest way to have to be mashing strings looking for keywords.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I am not much of a GUI programmer when it comes to doing complex stuff so I hope you will bear with me and help me fix this problem. I have a CPropertyPage that I want to contain a Custom Control so I went to the Dialog Editor and Dragged the Custom Control to it, assigned an ID, and put the name of the window class that I am using for it (I registered the class). Now when I start my dialog, which contains the property sheet and this property page, the page fails to display. The funny thing is, if I get rid of the property sheet and page and just put this same control in a dialog box, all my code works correctly. What am I doing wrong? Why does my stuff work in a Dialog Box but not in a property page?
Mark Cariddi
|
|
|
|
|
BTW, if all I do is get rid of the custom control , the property page that contained the control displays. For some reason the custome control is not getting created when it is in a propery control. Is DDX_CONTROL the proper way to assign a variable name to this control....
|
|
|
|
|
I've noticed within my MFC application that should a MessageBox() API be invoked while the user is displaying a context menu that the menu is taken down and the MessageBox is shown. However, if a DoModal() API is called to show one of my dialogs while a context menu is being shown the menu stays up but you can no longer select from it. Its kind of frozen.
How can I go about causing the context menu to go away prior to calling the DoModal() API? Is there a way to search for a visible menu and then subsequently destroy them? Any ideas or code snipits?
Craig
|
|
|
|
|
|
Thanks very much. That's just what I needed to learn.
Craig
|
|
|
|
|
Hello,
I was looking for way to enumarate applications systemwide that currently using serial ports, let's say to get PID of who currenly has open COM1 or COM2... Actually I'm interested in the ports that are in use: "Port Settings->Advanced->Com Port Number" from "(in use)".
Thanks
|
|
|
|
|
I have a CWnd-derived class. In the demo dialog I'm put the object from this class. I'm need to handle an arrow button push in the object of the CWnd-derived class, but I can't retrive a WM_KEYDOWN message.
Can somebody help me?
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
You're not getting WM_KEYDOWN at all, or just for the arrow ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm not getting WM_KEYDOWN at all, but I need a arrow button only.
I'm try to handle a message in the OnKeyDown() handler and in the PreTranslateMessage() method.
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Then something else is swallowing the message - what on the dialog has the focus ?
Christian Graus - Microsoft MVP - C++
|
|
|
|