473,395 Members | 1,639 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.

Managed C++ : How to call static class members?

Hi there...

VC++ newbie here.. I'm wondering how do I call the Static Members of classes
defined by a DLL.

For example supposed I have a function defined as :-

static neSimulator * CreateSimulator(const neSimulatorSizeInfo & sizeInfo,
neAllocatorAbstract * alloc = NULL,
const neV3 * gravity = NULL);

I'm guessing in Managed C++ I should call it as

neSimulator* gSim;
gSim=neSimulator::CreateSimulator(sizeInfo,NULL,&g ravity);

But on the call, I get a NullReference exception. And I have no idea what
I'm not doing properly, can anyone help.

ps. For those who know.. yup.. I'm trying to wrap the Tokamak Physics
Library... has anyone already done it? :P
Nov 16 '05 #1
1 3179
OK.. I think I've figured out what's wrong. It seems like I can't call the
function from ANOTHER managed project say VB.Net or another managed C++
project.

If I put the same code in a managed console project the code runs flawlessly
over all the unmanaged sections. Therefore I must be doing something wrong
that doesn't allow me to reference my class library project and use it as an
intemdiary to call the unmanaged functions via the IJW method.

Can anyone tell me what I'm doing wrongly?
Nov 16 '05 #2

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

Similar topics

0
by: Yoni Rabinovitch | last post by:
Hi, I am new to C#, so I apologise if this is a stupid question. I have some 3rd party C++ code, which gets built as static libraries (not DLLs). I want to create a C# form, which will call...
2
by: Neil | last post by:
I am developing a demo in C# using Managed DirectX. I wanted to use a C++ static library in the demo (its a class for handling physics), so I decided to create my Graphics classes in C#, inherit...
6
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
10
by: Edward Diener | last post by:
The documentation states the names of the various managed operators but does not give the signature for them. Is there some documentation which I have missed that gives the correct signature ? In...
7
by: Mark Prenter | last post by:
Hi all, I'm fairly new to .NET and I haven't done much in C++ before, nothing complex anyway, but I have a pretty good understanding of programming in general. What I'm trying to do is create a...
7
by: Steve Marsden | last post by:
Hi As a C programmer just starting to look at Managed C++, I was shocked to find that you cannot declare a managed type globally so that for example in a partiuclar module you can declare some...
1
by: slugster | last post by:
Hi, i originally posted this via another portal, but after giving it time to propagate it still hasn't shown up. My apologies for the multiposting. This might be a very simple question, but i...
5
by: raylopez99 | last post by:
I need an example of a managed overloaded assignment operator for a reference class, so I can equate two classes A1 and A2, say called ARefClass, in this manner: A1=A2;. For some strange reason...
3
by: =?Utf-8?B?TkVXMi5ORVQ=?= | last post by:
I have a static event declared in a C++ ref class, that can then be handled in a VB app. I'm trying to expose the static event through the interface that the C++ ref class implements so the VB app...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.