visual-c++

Call a COM DLL dynamically

I have an application in VC++ which needs to execute a function provided to it (function name entered in a text box) from a COM DLL (file name provided in another text box). I have seen code for loading a Win32 library using LoadLibrary and GetProcAddress. How can this be done for a COM DLL file (created in Visual Basic 6.0)? Is there...

What is the Visual C runtime?

Hello, I just wanted to know what is inside the Visual C ++ runtime DLLs? What code? Which functions? Just curious about that. Thanks in advance. ...

Can safearrays take, and marshall, user defined types?

I would like to move fairly complex types from the managed to native world and visa versa. Currently this is being done by creating multidimensional safearrays, which has the advantage that marshalling is done for you, but means we end up with rather complex jagged arrays to get our heads around. I have tried to put some structs into S...

Running an exe file from another exe file

I need to create a setup where there are two exe files in it and one exe must run after the other exe file. Is there way to do this without including a bat file? (Currently I'm using Visual Studio 2008 to create my setup) ...

Finding "dead code" in a large C++ legacy application

I'm currently working on a large and old C++ application that has had many developers before me. There is a lot of "dead code" in the project, classes and functions that aren't used by anyone anymore. What tools are available for C++ to make a analysis of large code base to detect and refactor dead code? Note: I'm not talking about tes...

Dll loading order

Hello If i have global variable in A.dll, that depends on global variable in B.dll , is it guaranteed that B.dll will be loaded before A.dll? I made two sample dll projects in Visual Studio, and link A.dll with B.dll , and it seems, that B.dll is loaded first.So is this behavior guaranteed ? ...

Integrate C++ Win32 Console project classes into Visual C++ (Windows forms application) project in Visual Studio 2008

Hi! I have written some classes, the back end of a project in C++ (win32 project) and then wanted to add a GUI to it. Visual C++ seemed to be a good solution but after having the GUI part done I couldn't integrate the plain C++ code. Does someone have any experience with that? I get 'unresolved externals' error. Apperantly the .cpp file...

How do I change the code page MS Visual Studio 2008 uses to open files?

Hi. I have a cpp file that uses ibm cp437 and Visual C++ keeps reading it with windows-1252. How do I make Visual C++ use the right code page for the file? ...

Confusion on Unicode and Multibyte Articles

By referring Joel's Article Some people are under the misconception that Unicode is simply a 16-bit code where each character takes 16 bits and therefore there are 65,536 possible characters. This is not, actually, correct. After reading the whole article, my point is that, if someone told you, his text is in unicode, yo...

How to Generate Raw packets and send to over network in vc++

hai.. how to generate raw pockets and send to another system using winpcap in vc++.i had done capture packets(sniffer) using winpcap in vc++ kindly help me Thanks ...

Converting static link library to dynamic dll

I have .lib file with its header (.h) file. This file have a few functions that need to be used in C# application. After googling i found that i need to create a dynamic dll from this static library and call this dynamic dll from C# code using interop. I have created a win32 project and selected type dll. Included header file and adde...

C4772 even when the type library is registered and present

I have a set of Visual C++ 9 COM component projects dependent on each other. ComponentA publishes its typelib into ComponentA.tlb. ComponentB imports ComponentA.tlb into ComponentB.idl and publishes ComponentB.tlb. Methods signatures in ComponentB.idl contain parameters of types defined in ComponentA.tlb. Both ComponentA and ComponentB ...

Visual Studio - can be a breakpoint called from code?

I have a unit test project based on UnitTest++. I usually put a breakpoint to the last line of the code so that the I can inspect the console when one of the tests fails: n = UnitTest::RunAllTests(); if ( n != 0 ) { // place breakpoint here return n; } return n; But I have to reinsert it each time I check-out the c...

Active X Development: VC++ or VB or Other technologies

We are in the process of creating active-x controls used within our application. Since Microsoft stopped supporting classic Visual Basic, is it wise to use Visual Basic to develop the Active X control or the latest VC++/ATL/MFC libraries provide more feature where we can create controls faster by leaving Visual Basic flexibility? We w...

How do we resolve C4055 Warning?

This is C4055 Warning message. 'conversion' : from data pointer 'type1' to function pointer 'type2' A data pointer is cast (possibly incorrectly) to a function pointer. This is a level 1 warning under /Za and a level 4 warning under /Ze. How do we resolve this warning?(By correct way, not a trick) Edit: This is a code...

Creating an MSVC import library from a DLL that uses stdcall

I have a dll that exports extern "C" __declspec(dllexport) int __stdcall Foo( void ); A dump of the dll shows ****************************************************************************** Section: Exports File Offset: 00001400 (5120) Flags: 00000000 Time Stamp: 00000000 Major Version: ...

Looking for a good C++ based RSS API

I tried http://code.google.com/p/feed-reader-lib but holy cow, talk about difficult to build. It has a nightmare of dependencies on Xerces and Xalan, both of which seem to be choking under the new VisualStudio 2010 C++ compiler. I've wasted hours trying to build this thing which is a shame. Does anyone have anything a little easier to hi...

mismatched #if/#endif pair in *.h file

Hello, Visual Studio C++ 2008 I have the following code in my server.h file. #if defined ( __linux__ ) void* get_info(void*); #elif defined ( _WIN32) void* WINAPI get_info(void*) #endif I keep getting the error: mismatched #if/#endif pair in server.h file The code looks ok to me, I can't understand why I am getting this ...

how to calculate crc16 in vc++

Hi I am using visual c++. I need to calculate crc16 16 bit checksum on packet data. Their is one getCRC32 function but i did not found any crc16 bit function. thanks ...

building decnumber++ in visual studio

hi there, i'm getting errors when trying to build the decnumber++ library in vs2008. the error i'm getting is C2995 and C2666. to me it seems visual studio is not allowing template function overloading? if anyone has any ideas i would really love to hear them. if anyone would like to try and build this decimal library in VS to see if th...