|
Member 3112447 wrote: can i have two cpp files in the source with int main()
Not if it's a console app - the C runtime library wants to link to the main from your app. If your app has two main s, then there will be an ambiguity; the runtime won't know which main to link with.
Similarly, a GUI Windows app is looking for WinMain (or wWinMain if you're using Unicode). You can't have two WinMains in a GUI app.
Member 3112447 wrote: how can i make them both execute simultaneously
In the same process? Make them functions that execute in separate threads[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Folks,
I have a project I'm trying to convert from VC++ MFC to VS2005, and I'm having a problem with msxml (and I know NOTHING about MFC -- have never coded in it).
Basically, there is an msxml.cpp/.h in the project directory, and when I compile, I am getting type redefintion errors.
MSXML.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(972) :
error C2011: 'XMLDOMDocumentEvents' : 'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) : see declaration of 'XMLDOMDocumentEvents'
in the PROJECT msxml.h:
class XMLDOMDocumentEvents : public COleDispatchDriver
and in the platformsdk\Include\msxml.h:
XMLDOMDocumentEvents : public IDispatch
Looks like it is pulling in not only the local msxml (which is what I want it to use), but also the
c:\program files\Microsoft Visual Studio 8\VC\PlatformSDK\include\msXml.h
so I am getting the redef in the project msxml stuff.
I don't see any real way to EXCLUDE only that platformSDK\Include\msxml.h file during compilation.
I've tried the tools->options->project..-> VC++ directories, but if I exclude that platformSDK\include, I get all sorts of badness happening.
If I get rid of the local msxml.h/cpp, I also get bad things happening (due to used objects from that old msxml missing)
Any help greatly appreciated.
|
|
|
|
|
Add your local directory to the C++->General->Additional Include Directories property (Debug AND Release). That should mean the compiler sees your local msxml.h before (and instead of) the Platform SDK one.
Or, change the msxml #includes to
#include "./msxml.h"
I think that might work as well?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks -- actually DID include the local dir to resolve a few other issues -- this one is the only one I have left outstanding at the moment (at least until THIS one clears and the compilation finds something else )
I have tried the "./msxml.h" also, but I am still getting that error message (I even put in the entire path, same result).
|
|
|
|
|
gartnerj wrote: I have tried the "./msxml.h" also, but I am still getting that error message (I even put in the entire path, same result).
Well, that's spooky.
Have you changed ALL #includes of msxml.h? Try checking stdafx.h and rebuilding from scratch.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yeah, really strange.
There are only two references to #include "msxml.h" in the project:
1)a generated MSXML.cpp file
2)a DataParse.h (which is where a bunch of custom parsing code is defined).
No other #include of msxml.h at all!!
|
|
|
|
|
|
Thanks David,
I had seen the WIN_LEAN_AND_MEAN setting and had tried that with no luck.
I tried the VC_EXTRALEAN, and I still get the errors:
DataParse.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) :
see declaration of 'XMLDOMDocumentEvents'
MSXML.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) : see declaration of 'XMLDOMDocumentEvents'
No joy yet.
|
|
|
|
|
Actually, looking in the code, the stdafx.h file HAS the define for VC_extralean - must have done that during the conversion up to VS2005!
|
|
|
|
|
Ok, lets be patient and work through this. First thing you need to do is find out where msxml.h is being included. Do you have #include <urlmon.h> included anywhere?
Best Wishes,
-David Delaune
|
|
|
|
|
Windows.h #includes Ole2.h which #includes ObjBase.h which #includes urlmon.h
No way round getting the SDKs msxml.h, as far as I can tell.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Just checked, and NO, no ulrmon.h in any of the project files.
|
|
|
|
|
A suggestion. Stuff your local msxml.h inside a namespace when #including it:
namespace Old
{
#include "msxml.h"
}
and then explicitly specify the namespace when using the structures out of your local file - e.g.
Old::XMLDOMDocumentEvents events;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I'll have to give that a try -- will try to get to it later this morning -- working on a different project at the moment!
|
|
|
|
|
Stuart -- thanks. Using the namespace seems to have worked (at least, it got rid of the compilation errors and let me build the project).
Thanks folks for all of the help!!!
|
|
|
|
|
Hi All,
Please let me know whether we can call functions of a win32 dll from a ASP.Net Web Page.
Regards,
Ashwath Hegde
|
|
|
|
|
|
Hello,
I am creating an application that is stylistically similar to outlook express. I'd like to be able to create header or banner images, with anti-aliased text that can be changed dynamically. They would be displayed in the MainFrame, and would describe the nature of the current view (in outlook express, these are Inbox, Outbox, Sent Items, etc).
At the moment I'm simply using CBitmaps that load bitmap resources.
I guess the way to do this would be to create a class that inherits from CStatic or CBitmap, and uses GDI to draw the anti-aliased text. I'm at a bit of a loss as to how to proceed though - should I use an existing Codeproject class, or roll my own? My requirements really are simple - I want anti-aliased white text across a plain background, as a drop in replacement for my existing CBitmaps, that looks like outlook express.
Regards,
Sternocera
|
|
|
|
|
i am working in visual C++ and have installed the LEDA library. i have added the graphwin.cpp file provided during the installation. What i get know is a graph editor window called graphwin 1.8. using this graph editor i can create a graph with any number of nodes and edges. it also provides me with a built in menu bar with options like file, layout etc. MY DOUBT IS how can i make say for instance a button, which once clicked by the user asks for specificing the amount of traffic...please please help if you have any idea about this...thanks..!!!
|
|
|
|
|
Hi All,
Please let me know whether we can call functions of a win32 dll from a vb.net application.
Regards,
Ashwath Hegde
|
|
|
|
|
Yes, we usually can.
(see, for instance, here [^]).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes you can, follow these two steps.
Step 1: You have to declare this DllImport attribute which allow specifying the name of the dll which contains the method.
Step 2: Then you have to specify the signature of the API, after which you can call the method passing the correct parameters.
As for example:
[DllImport("User32.dll")]
static extern bool MessageBox(IntPtr hWnd, string lpText,
string lpCaption, uint uType);
IntPtr hWnd= this.Handle;
MessageBox(hWnd, "Hi", "Click Me", 0);
hWnd is the handle of the form.
|
|
|
|
|
Thank you very much for the answer.
|
|
|
|
|
I am looking for 8bit checksum algorithm for my 15W packet.
Thanks!!!
|
|
|
|
|
resolvequestion wrote: I am looking for 8bit checksum algorithm
Does this help?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|