visual-studio-2005

How to use tlb files in a native C++ project

跟風遠走 提交于 2021-01-27 05:59:15
问题 I have a tlb files that contains some function declaration that I need to use. If I use #import "type_library.tlb" I can correclty reference the function from my code: tlb_namespace::required_function(); But when I compile the project the linker says that tlb_namespace::required_function is an unresolved external symbol. How can I succesfully build this kind of project? EDIT : I have used the same type library in a Dummy VBA access project. I have added the reference to the type library and I

How to use tlb files in a native C++ project

▼魔方 西西 提交于 2021-01-27 05:59:12
问题 I have a tlb files that contains some function declaration that I need to use. If I use #import "type_library.tlb" I can correclty reference the function from my code: tlb_namespace::required_function(); But when I compile the project the linker says that tlb_namespace::required_function is an unresolved external symbol. How can I succesfully build this kind of project? EDIT : I have used the same type library in a Dummy VBA access project. I have added the reference to the type library and I

what is difference btw /MD and /MDD in VisualStudio C++?

自作多情 提交于 2021-01-27 04:54:09
问题 What is difference betwwen /MD and /MDD( multi threaded debug dll ) in c/c++->code generation propertis of visual studio .... 回答1: They specify which runtime to use. Both use mmulti-threaded dynamic (DLL) runtimes, but the /MDD version uses the debug version and also defines the _DEBUG symbol for you. See this MSDN page for details. 回答2: The debug version (MDD) allows you to step into the C and C++ libraries, during debugging. There are additional checks for incorrect heap operations and

How does this C++ code compile without an end return statement?

自闭症网瘾萝莉.ら 提交于 2020-11-29 09:27:45
问题 I came across the following code that compiles fine (using Visual Studio 2005): SomeObject SomeClass::getSomeThing() { for each (SomeObject something in someMemberCollection) { if ( something.data == 0 ) { return something; } } // No return statement here } Why does this compile if there is no return statement at the end of the method? 回答1: This is to support backwards compatibility with C which did not strictly require a return from all functions. In those cases you were simply left with

Reuse of va_list

蹲街弑〆低调 提交于 2020-05-14 16:59:29
问题 I need to do two (or more) passes over a va_list . I have a buffer of some size, and I want to write a formatted string with sprintf into it. If the formatted string doesn't fit in the allocated space I want to double the allocated space and repeat until it fits. (As a side-note, i would like be able to calculate the length of the formatted string first and allocate enough space, but the only function that I found that can do that is _snprintf, and it is deprecated in VS2005 ...) Now, so far

How to include sub-directories in Visual Studio?

▼魔方 西西 提交于 2020-05-09 20:50:48
问题 I have to include many header files, which are in different sub-directories. Is there a way in Visual Studio (I am using 2005 edition) to set one include path that Visual Studio will search also the sub-directories for header files? 回答1: Setting the folder search paths in the Visual Studio settings to fix an include issue is generally not really a good idea from a design point of view. Your code will be less portable to different machines with different directory lay-outs. My suggestion would

Convert C# project into Dll for C++ project

╄→尐↘猪︶ㄣ 提交于 2020-02-24 09:05:22
问题 I am a newbie to C#. I am currently working on learning C# code. My final goal is to convert a C# project into a dll so that I can use it in my C++ exe. I am using VS2005. I was wondering if it's possible and if so I would appreciate for some guidance and suggestions in this regards, Please do reply back, 回答1: Why not to make a com object out of your managed lib and call it from the unmanaged c++ code? It's relatively easy to do if you know how to manage com in c++.. http://msdn.microsoft.com

Convert C# project into Dll for C++ project

我的未来我决定 提交于 2020-02-24 09:04:34
问题 I am a newbie to C#. I am currently working on learning C# code. My final goal is to convert a C# project into a dll so that I can use it in my C++ exe. I am using VS2005. I was wondering if it's possible and if so I would appreciate for some guidance and suggestions in this regards, Please do reply back, 回答1: Why not to make a com object out of your managed lib and call it from the unmanaged c++ code? It's relatively easy to do if you know how to manage com in c++.. http://msdn.microsoft.com