|
Neville - a suggestion - why not use Process Monitor[^] to see what Windows is actually looking at - you may well find the operation that can't find abc.def, and that might give you the clue you need to solve the problem?
That's what I'd do, anyway!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks Stuart. I just tried PM and scanned several thousand log entries but nothing really stood out. MS has changed (broken) various aspects of File Associations with Vista and MFC in VS2008 has not been updated to address these issues. That said I don't think this is the cause of the error. It seems as though Windows Explorer is misreading what is going on.
|
|
|
|
|
Neville Franks wrote: MS has changed (broken) various aspects of File Associations with Vista
Mostly to do with DDE from what I've read?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: Neville Franks wrote:
MS has changed (broken) various aspects of File Associations with Vista
Mostly to do with DDE from what I've read?
Yes DDE no longer works in Vista from Explorer, yet CDocManager::RegisterShellFileTypes() still registers as a DDE client. Further RegisterShellFileTypes() still uses HKEY_CLASSES_ROOT which can't be used on Vista. There is a Linker option "Per-User Config" and AfxSetPerUserRegistration() which I assume trigger RegOverridePredefKey() so HKCR morphs across to HKCU. And finally Vista has a new IApplicationAssociationRegistration::SetAppAsDefault Method which adds an app to the list of Default Applications and uses HKCR!!!
It only took me most of yesterday to get to the bottom of this. (:
|
|
|
|
|
Hopefully it won't change too much more for Windows 7...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: Hopefully it won't change too much more for Windows 7...Unsure
Well I'll be testing that next. But one has to assume (pray/hope) it is the same as Vista.
I think I've finally found the cause which is a lurking HKCR shell\open\ddeexec = [open("%1")] entry. I thought I'd got rid of these, but this one reappeared. Maybe I'll end the week (Oz) on a good note after all.
|
|
|
|
|
Im looking for documents(programming languages) that would guide me in creating an interface that reads network data. So i guess i should start by creating the interface or finding out how to read network data and input database.
|
|
|
|
|
You will probably be more sucesful if you slit that work into separate tasks. For instance, learning how to create a UI is completely independant on learning how to read the network data. What is your experience in programming ? Did you already develop some programs with a UI ?
|
|
|
|
|
Im going to use ms visual web developer 2008 for the interface. in the .net frame work there is System.Net.NetworkInformation class which pulls network information. But im not really sure how to use the class. and my programming experience is novie/mid-level
|
|
|
|
|
i have created a vc++ win32 project in visual studio 2008. can i have two cpp files in the source with int main()..??? if no then what do i have to do...how can i make them both execute simultaneously..?? please help i am totally new to this...
|
|
|
|
|
Yes, you can have many source files in a project.
Member 3112447 wrote: how can i make them both execute simultaneously..??
What do you mean by that?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
i mean each time i try and execute i only get the output of the first cpp code which contains int main..why cant i get the output of the second..
|
|
|
|
|
like i want to get output for this code:
#include <LEDA/graph/graph.h>
using namespace leda;
int main()
{
graph G; //define directed graph G
node center=G.new_node(); //create new node "center" of G
int i;
for (i=0;i<100;i++) {
node v=G.new_node(); //create new node v of G
G.new_edge(center,v); //create new edge of G
//with source center and target v
}
edge e;
forall_edges(e,G) { //iterate over all edges e of G
node source=G.source(e); //compute source of e
node target=G.target(e); //compute target of e
std::cout << "edge ";
G.print_edge(e); //print edge
std::cout << " has source ";
G.print_node(source); //print source
std::cout << " and target ";
G.print_node(target); //print target
std::cout << std::endl;
}
return 0;
}
and the following was the .cpp file i added to the source code folder at the time of installation
#include <LEDA/graphics/graphwin.h>
#include <LEDA/system/file.h>
#include <LEDA/graphics/bitmaps/button32.h>
#if defined(LEDA_NAMESPACE)
using namespace leda;
#endif
#if defined(WINMAIN)
int main() {
int argc;
char** argv;
get_command_line(argc,argv);
#else
int main(int argc, char** argv) {
GraphWin gw1;
int menu1 = gw1.add_menu("Routing Game Type");
gw1.add_menu("atomic",menu1);
gw1.add_menu("non-atomic",menu1);
//gw1.add_separator(menu1);
gw1.display(); gw1.edit();
return 0;
#endif
string frame_label("Leda Graph Editor (GraphWin %.1f)",
GraphWin::version());
GraphWin gw(frame_label);
window& W = gw.get_window();
gw.display(400,window::center);
W.set_icon_label("GraphWin");
W.set_cursor(XC_watch);
string home_dir = get_home_directory();
home_dir = home_dir.replace_all("\\","/");
string rc_file = home_dir + "/.graphwinrc";
if (is_file(rc_file))
{ gw.message("Loading Options from\\blue " + rc_file);
leda_wait(1.2);
gw.read_defaults();
}
else
{ gw.message("No\\blue " + rc_file + "\\black ~(using built-in defaults).");
leda_wait(1.8);
}
gw.message("");
if (argc > 1)
{ string fname = argv[1];
string gname;
if (fname.tail(4) == ".gml")
{ gname = fname.del(".gml");
int err = gw.read_gml(fname);
if (err) gw.acknowledge("Error Reading GML-File", fname);
}
else
if (fname.tail(7) == ".dimacs")
{ gname = fname.del(".dimacs");
int err = gw.read_dimacs(fname);
if (err) gw.acknowledge("Error Reading Dimacs File", fname);
}
else
{ gname = fname.del(".gw");
int err = gw.read_gw(fname);
if (err && err < 5) gw.acknowledge("Error Reading GW-File", fname);
}
gw.set_graphname(gname);
}
int but = 0;
//bool save_defaults = false;
int def_choice = 0;
W.set_cursor();
while (but == 0)
{
gw.edit();
panel P;
P.text_item("");
P.text_item("\\bf\\blue Exit GraphWin");
P.choice_item("Options in ~/.graphwinrc",def_choice,"keep","write","reset");
if (gw.unsaved_changes())
{ P.text_item("\\bf Graph not written since last change !\\n");
P.button("save gw",3);
P.button("save gml",4);
}
P.button("cancel", 0);
P.button("exit",1);
P.buttons_per_line(4);
but = gw.open_panel(P);
if (but == 3) gw_save_handler(gw);
if (but == 4) gw_save_gml_handler(gw);
if (but != 1 && gw.unsaved_changes()) but = 0;
}
if (def_choice != 0)
{ if (def_choice == 2) gw.reset_defaults();
gw.save_defaults();
}
return 0;
}
|
|
|
|
|
Rename the second one so it's called something other than main and call it from the first main. You'll also need to tell the first main about the renamed function:
first_main.cpp
extern int second_main(int argc, char** argv);
int main(int argc, char** argv)
{
return second_main(argc, argv);
}
second_main.cpp
int second_main(int argc, char** argv)
{
return someValue;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
modified on Thursday, July 16, 2009 7:07 PM
|
|
|
|
|
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
|
|
|
|