Debugging an DLL build with /CLR compiler option Hello, Normally, debugging an DLL written in unmanaged code is no problem, but when i build the DLL with the /CLR compiler option and calling mannaged code, the Microsoft Development Environment comes with the message: "Unable to start debugging" Changing "the type of debugger" from "Auto" to "Native Only" will get the application running, but i can't debug it. Development environment: Windows XP Visual studio 2003 .NET Framework 1.1 Thanks, Alexander #include "stdafx.h" #include "dlltestclr.h" #using "mscorlib.dll" #using "system.windows.forms.dll" #using "vision.dll" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { return TRUE; } #undef MessageBox __declspec(dllexport) int __cdecl VisionInit(HWND handle) { Vision::AnalyseGebied* analyseGebied = Vision::AnalyseIO::ReadFromFile("AnalyseGebiedConfig.xml"); System::Windows::Forms::MessageBox: how(analyseGebied->Header->Copyright); System::Windows::Forms::MessageBox: how(analyseGebied->Header->Blabla); return -1; }
Code Snippet Tag: Visual C++ General IExplorer headers catching Visual C++
How can I Get an XP Look for CWebBrowser2? The appearance of the toolbar buttons is limited to what the control will allow. You can customise the toolbar to a certain extent. Please see http://msdn2.microsoft.com/en-us/library/aa753592.aspx for details. Try installing IE7 to see if you get a newer version of shdocvw.dll which may have a toolbar with a different appearance.
BTW, CWebBrowser2 is the default name of the wrapper class generated by the class wizard in VC6, using that name can be confusing to the reader. You can call it the Microsoft WebBrowser control or use the name of the interface IWebBrowser2.
Regards
Sahir Shah Tag: Visual C++ General IExplorer headers catching Visual C++
Unexpected namespace pollution in VC8 (bug?) This issue is present in VC versions 7.0, 7.1 and 8.0. You should report it at http://connect.microsoft.com/VisualStudio . Post the resulting URL here. Tag: Visual C++ General IExplorer headers catching Visual C++
CLR corrupts stack! What are your compiler settings Are you using the /clr flag. This could be a bug, but I'd like more context so I can verify. Tag: Visual C++ General IExplorer headers catching Visual C++
Autogenerated copy constructors and equals operators Lord Zoltan wrote:
Anyone know how to inhibit the compiler's autogeneration of copy constructors and equals operators for classes other than defining your own
Declaring (not defining) a private copy ctor and assignment operator is common practice to avoid copying classes which shouldn't be copied. Boost's noncopyable is one base class which enforces this principle. Tag: Visual C++ General IExplorer headers catching Visual C++
Parallel Port Hi Swarts,
If you want to use the inpout32 library then take the following steps:
First, copy the inpout32.dll and inpout.lib files into your project directory. inpout.lib can be found in the VC_test_app directory. Now go to the project properties page, click through Configuration Properties->Linker->Input. Where it says Additional Dependencies add "inpout32.lib" to the list.
Next you need to include the function declarations somewhere in your project:
Code Snippet short _stdcall Inp32(short PortAddress); void _stdcall Out32(short PortAddress, short data);
Now you can just call either of those functions to send or receive data on the parallel port. Normally, the port address is 0x378 but you shouldn't rely on that.
John. Tag: Visual C++ General IExplorer headers catching Visual C++
Extended ascii char set Could you explain the problems you are having more. It's not working isn't very helpful so more information is needed before anyone could help you more. What is needed is a code sample of what you are doing and the problems you are experiencing. Tag: Visual C++ General IExplorer headers catching Visual C++
64-bit apps need larger stacks than 32-bit It would -because addresses and pointers are now 64 bit instead of 32-, though lack of stack space is usually only a problem with deep recursion.
If you design an algorithm like that, you always have to
a) be sure that you compile with enough stack space, or create threads with enough stack space for your algorithm
b) surround your recursive algorithm with __try __except so that you can safely catch the exception that indicates 'out of stack space' if that should happen
Increasing the default would mean that all threads would run with that default, which would be a bit overkill to solve a problem that is only a problem if you did not think about it in your design phase.
I know some people will disagree with me, but I think that recursion should be avoided in production level software.
In all but the simplest cases, it becomes very hard to maintain, very hard to prove that all possibilities lead to a known result, and very hard to transfer ownership to someone else.
On top of that, anything you can do recursively you can do in a loop, using something like std: tack to store the state variables. Loops are much easier to debug, maintain and prove for correctness, and you don't have to worry about the stack space problem. Tag: Visual C++ General IExplorer headers catching Visual C++
Vista UAC in vc++ You aren't going to be able to disable UAC without being first elevated by UAC... in which case your app would be running with administrative permissions and likely able to do everything you want to do with UAC disabled... something that would also be the case for any applications that your app launches (while elevated). Is running your app as Administrator not an option Why not Why do you think that temporarily disabling UAC would be better Tag: Visual C++ General IExplorer headers catching Visual C++
GetDC() call Actually it depend on what you are drawing using device context. But,I never seen device context as member variable. Tag: Visual C++ General IExplorer headers catching Visual C++
keeping global variables alive in xll This is a Visual C++ forum.
Try asking in an Excel forum or Visual Studio tools for office forum. Tag: Visual C++ General IExplorer headers catching Visual C++
Question on including header files to project in VC++ If the file you mentioned(header) is in same folder as cpp you want to include this header in, then # include "xxx.h" will work.
xxx.h must be present in one of folders mentioned in Tools-->options-->Directories-->Includes Files to line mentioned by you. Tag: Visual C++ General IExplorer headers catching Visual C++
Syntax to use pin_ptr on a multi-dimensional array? Right now I have gotten this to compile... wfunction(array<long, 2> ustart) { // use pin_ptr to "convert" the manage array to native array cli: in_ptr<long> ppUstart = &ustart[0,0]; long *nativeUstart = ppUstart; // call nfunction() with the "native array" } Is the above correct I'll try it out and see... Tag: Visual C++ General IExplorer headers catching Visual C++
Mixed Mode : Should definitions be in the headers when creating static mixed lib? I cannot explain why, but if you add these lines to MixMe.cpp file:
void dummy()
{
}
and then add these lines to main function:
extern void dummy();
dummy();
and also ensure that the main project is made dependent on static library, then the linker errors seem to disappear. Tag: Visual C++ General IExplorer headers catching Visual C++
Error with map<string, vector<vector<string> > > Probably the Visual Studio Debugger is not yet able to display such complex data type. But the map contains a good value. In order to check, add this line:
const vector< vector< string > > & vvs1 = m["key"];
The value of vvs1 will be displayed correctly.
I think this debugger problem can be reported to Microsoft at http://connect.microsoft.com/VisualStudio/feedback . Tag: Visual C++ General IExplorer headers catching Visual C++
Windows forms help Lutzee wrote: Anyway from game i can declare a pointer of type class1 and access class1's data members, functions etc from a function inside game. I can also declare a pointer of type form1. However when i come to access form1's data members using this pointer it won't let me alter them it just says: error C2227: left of '->richtextbox1' must point to class/struct/union/generic typ
That is because the type form1 is not known.
#pragma once class class1; //I was told these lines make this class aware of the class form1; //other class it needs to access.
That is called forward declaration. It's not enough. In the cpp file you'll still have to include the header, which you don't do.
class game { public: int room; form1* form1; class1* class1; game(void); public: int travel(game game); virtual ~game(void); };
Duh... don't use type names as variables. form1 is a type, you use it as a variable name too. Put an underscore or something.
form1* form1_;
class1* class1_;
//game.cpp #include "StdAfx.h" #include "game.h"
You did not include neither "form1.h" nor "class1.h".
I suggest you get a good C++ book and learn the language.
Here is a list of C++ FAQs that may also help you. Tag: Visual C++ General IExplorer headers catching Visual C++
spy++ doesn't monitor reflected messages (OCM_*)? You should see them, they'll just have a 0x2000 message number offset. Spy++ probably won't crack them nicely like .NET does. It certainly isn't the greatest tool. Check out Winspector . Off topic for Windows Forms, moved to C++ General. Tag: Visual C++ General IExplorer headers catching Visual C++
Runtime libraries I am not sure I understand your question. I think an easy answer is that if compatible libraries are used consistently within the output of the linker, you will be safe. I am not sure of this, but I think it is true most of the time at least. If you did not develop the plugin, then I assume it was developed for general-pupose use in the manner you describe. If you do encounter a problem you can't solve, then post a question about that. When I say output of the linker, files with exe or dll extensions are usually created by the linker. Tag: Visual C++ General IExplorer headers catching Visual C++
Compiler directive to allow use of deprecated items? There's nothing preventing you from using deprecated items, granted that they are still available in header files and libraries. Do you wish to remove the warnings as well Tag: Visual C++ General IExplorer headers catching Visual C++
File writing in VC++6.0 Are you sure that the data you passed to fwrite was correct image data
Verify if the data in written file is same as what you wanted to write, you can open the image as binary file in editor like utraedit (VC++ will do too). Tag: Visual C++ General IExplorer headers catching Visual C++
How do I compile c++ code into a EXE file you mean compile your code without IDE if so, you can use CL.exe located in "C:\Program Files\Microsoft Visual Studio 8\VC\bin\". the usage of cl.exe is like: cl [ option... ] filename... [ /link linkoption... ]. Tag: Visual C++ General IExplorer headers catching Visual C++
textBox - 2 questions Yosef Karasik wrote: I have a textBox controler in my win app that i write in c++
First of all, please, can you explain us what's a "textBox controler" Tag: Visual C++ General IExplorer headers catching Visual C++
Printing strings of TCHAR[] into a file I found out that if you cast each character in the TCHAR array into a char then copy it into a newly declared char array with allocated size then it successfully converts a DBCS to a SBCS. Tag: Visual C++ General IExplorer headers catching Visual C++
Is it just me? Deleting handlers and functions w/VC2005 impossible Unfortunately, due to the IDE unification (C#, VB and C++ all use the same core IDE), some handy C++ specific IDE features got lost in the 2003/2005 releases. Your best option would be to purchase a 3rd party IDE enhancement product like Whole Tomato's Visual Assist - which should bring back a lot of sanity to the VC++ programming environment.
The next release (Orcas) has quite a few improvements for C++ - but that's still an year away. But it's a good thought to have for now :-) Tag: Visual C++ General IExplorer headers catching Visual C++
Exception from Invoke method Use a debugger to see what's going on.
The first step would be to identify where exactly the exception happens. That may be less than trivial in the C++ managed debugger. However, the _full_ callstack should give you an indication of what's going on.
Taking a look at the callstack of the exception would help. You can either catch the exception in code and take a look at the stacktrace or use the managed (non-C++) debugger and take a look the pseudo register for the current exception ($exception IIRC).
-hg Tag: Visual C++ General IExplorer headers catching Visual C++
exjay
Hi, all. Does anyone know, how to catch headers of my request, using IE Event model