473,395 Members | 1,383 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

problem static linking MFC C++

I am trying to "wrap" an MFC C++ class in Managed C++.
I am getting a System.NullReferenceException everytime i try to execute a
function.
I don't ahve a clue if i'm doing it right, but i'm trying very hard :)

Here is my code for the MFC/C++ Class:

class ActLib
{
public:
ActLib(void);
~ActLib(void);
CString Simple(CString s);
};

ActLib::ActLib(void)
{
}
ActLib::~ActLib(void)
{
}
CString ActLib::Simple(CString s)
{
return s + "85";
}

And here is how i'm trying to wrap it:

namespace StaticLinkTest
{
public __gc class HelperWrap
{
// TODO: Add your methods for this class here.
public:
HelperWrap() : m_pActLib(new ActLib()) {}
String* Simple(String *s);
private:
ActLib *m_pActLib;
};
}

String* StaticLinkTest::HelperWrap::Simple(String *s)
{
return m_pActLib->Simple(s);
}

When i hit F10 on the single line in the HelperWrap::Simple() function, i
get the System.NullReferenceException error...
Any ideas what this could be?
I'd appreciate any help.

Tim
Nov 16 '05 #1
0 1221

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dibyendu Roy | last post by:
Hi All, I build an object called "dblorcle" to connect to oracle database in Sun solaris box. This is built linking with various oracle ".a" (archived, for static linking) files come with standard...
7
by: Ittay Dror | last post by:
Hi I have this peculiar situation. I have a library of utility classes, which I use to compile a binary. I want to reimplement a method in class. The class is only a collection of static...
1
by: Peetah_junkmail | last post by:
Hi, I'm not sure this is completely a C related question since it's more about linking problems, so don't hesitate to redirect me to a more appropriate NG. I have a set of useful functions...
6
by: Andrew S. Giles | last post by:
Is it possible to bring in a static library (developed in C++) into a C# project/solution? Thanks in advance for any information. Andrew S. GIles
0
by: zhangrusi | last post by:
I have a static library that is compiled using the latest version of VC 6. It uses the multithreaded DLL versions of the run-time library, and it uses STL classes. I would like to make use of this...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
1
by: srikar | last post by:
what is the difference between static linking & dynamic linking, what are the advantages of each? How to perform static linking & Dynamic linking by using gcc -o liniking will be done , but...
2
by: ashesman | last post by:
OK, I have written an application in MS Visual C# using .net. Is it posibble to static link into one self contained .exe file? This would certainly make distribution of a small accessory file...
2
by: jitender001001 | last post by:
hi all I have a problem of linking static libraries with GC_MALLOC, I have made my routine smaller to make it simpler. I m using fedora 7 kernel version 2.6.18-1.2798.fc6 void str_check_alloc(...
2
by: NvrBst | last post by:
I have C99 code (which I changed extensions to .cpp to compile as C+ +98). Which is does fine. I create a Static Library Project (.lib) and Build, and it builds the .obj files (9 of them) and...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.