|
Check out Object.ToString(). It is overridden for pretty much all base types.
System::String^ MeM::X()
{
return stat.dwTotalPhys.ToString();
}
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
wow so much help in so short time
thank you too
|
|
|
|
|
Mark Salsbery wrote: stat.dwTotalPhys.ToString();
led mike
|
|
|
|
|
Heh now what did I do?
The OP wanted a string representation of a DWORD right?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
You can call ToString on a DWORD? Let me see... Well I'll be a Fish Filet eatin goober!
led mike
|
|
|
|
|
Filet-o-Fish is on me! Yes, you can. Built in types automagically convert back and forth
from managed types.
You had me worried - I had to check on VS 2005 real quick (I'm still on 2003 .NET) to see if it
didn't work anymore. That would have sucked
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I'm trying to replace a MFC CView with a form. The Cview in a Container that several Controls is inserted into. That way events are controlled with a common response, however control is same for each, but the control functions can be different. It will be part of a MDI Application.
I’m looking for a book or website. I would like to create a nice application to for all these "views". Several can be open at once.
PS: I’m new to using forms. My past GUIs where written in MFC.
Thanks
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Hello,
I have a strange problem. If I have an RootNamespace for a project
e.g Microsoft::Bug
and I make a new Form then I receive an error from ResGen (Invalid file Microsoft::Bug.Form1.resources)
How I can make this namespace in the way that also the resources works automatically?
Okay I can change the output file for every resource but I don't think that this is a good way!
Best regards
Hansjörg
|
|
|
|
|
Hi, i've a problem with a method that had to return a pointer.
In this class, i've implemented a method tha return a pointer.
class Camobj
{
public:
Camobj();
~Camobj(void);
IplImage* capture(void){
//create a IplImage* img;
return(img);
}
};
private:
....
};
In another class(window form) form1.h, i want to visualize my IplImage returned from capture method of Camobj:
#include "camobj.h"
....
public ref class Form1 : public System::Windows::Forms::Form
{
...
protected:
//Create a Camobj object
Camobj *mycam;
public:
Form1(void)
{
InitializeComponent();
mycam=new Camobj();
}
....
private: System::Void capimgbut_Click(System::Object^ sender, System::EventArgs^ e) {
IplImage* kon=mycam->capture(); //it would return a IplImage*
cvShowImage("try",kon);//cvShowImage(const char *name ,const Iplimage *image)
}
....
The problem is that it seems to not receive anything? is it possible?
Thanks, regards.
|
|
|
|
|
Hi to all of you,
I am a new programmer on OpenGL.
I am currently working on an application where I have a Debian Linux PC with two usb industrial cameras,acquiring images at a rate of 25fps. Each image data is sent by sockets to a windows PC. The format of the received buffer at the windows PC side is buffer[0]='top left image pixel', buffer[640*480]='bottom right image pixel'. I want know to proccess these buffers an display a video on an OpenGL window at a similar frame rate, or even lower,i.e. even 5-10 frames per second will do for me.
Can anynone advised me with an appropriate approach?
Cheers,
DoctorDoctor
|
|
|
|
|
Hi,
Does anybody now a macro to check if only one bit is set in a word value ?
Thx
|
|
|
|
|
Hi,
I have a menu on my application that contains a HELP toolstrip, I've finished doing the help project using the HTML workshop. Now how can I link this toolstrip to the Help.chm file?
thanks in advance,
|
|
|
|
|
From managed code using .NET?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
|
|
I've ref class. I 've to use a function "ccap_start_capturing" that take a ptr,and a ptr to a callback function(on_jpeg_received) and another ptr to a function on_exit_capturing defined in this class. Both "ccap_start_capturing" and "on_jpeg_received" functions are defined in a file c that i can't modify.
//#include ...
ref class CamPanObj{
public:
CamPanObj(){
camaddr=new camaddr_t();
}
protected:
~CamPanObj()
{//...
}
public:
static void on_exit_capturing(int code)
{/..
}
CAPID rec_start(void)
{
...
capid=ccap_start_capturing(camaddr,on_jpeg_received,on_exit_capturing);
return (capid);
}
};
It returns a compile error
error C2664: 'ccap_start_capturing' : cannot convert parameter 3 from 'void (__clrcall *)(int)' to 'void (__cdecl *)(int)'
None of the functions with this name in scope match the target type
How can i resolve it?
Thanks, regards.
|
|
|
|
|
I have 2 applications in which I serialize data in one and deserialize data in the other utilizing the binary formatter. However, whenever I try to deserialize, I get the following exception error:
"An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll. Additional information: Unable to find assembly 'projectname, Version=1.0.XXXX.XXXX, Culture=neutral, PublicKeyToken=null'.
I tried to resolve the assembly that it is trying to find by using the System::ResolveEventHandler delegate and registering this method with the System::AppDomain's AssemblyResolve event before calling the Deserialize method. The problem is the ResolveEventHandler never gets fired, so I can't even attempt to load the assembly and consequently, it always fails at deserialization. Are there any ideas of what I am doing wrong or any examples of code I can look at?
|
|
|
|
|
I don't know if I understand it right. The error happens normally only if in the data which is deserialized are classes from an assembly which is not known in your project. Do you have a reference to this assembly in your second project?
Best regards
Hansjörg
|
|
|
|
|
Yes, I have referenced the assembly in my second project. I found that I was unable to fire the ResolveEventHandler because there was a copy of the first executable in the same directory as my second executable. When I removed this first executable from the same directory, the ResolveEventHandler gets fired. However, now I am having issues with Assembly::Load. It appears that this Assembly::Load is getting called over and over without ever returning the assembly. Eventually, I get a stack overflow exception error. Any ideas?
|
|
|
|
|
I'm pretty new to C++/CLI so please bare with me. I have a header "MyThread.h" that contains a Thread class. I added an include directive at the top of my frmMain.h so i can create an instance of this class. Everything is fine with that but when i include frmMain.h to MyThread.h i get alot of compile errors. I read somewhere of where you could add something like:
#ifndef FRMMAIN_H
#define FRMMAIN_H
#endif
to fix the issue but it isn't working. Any ideas?
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
In one of the header files, you'll probably need a forward reference to avoid circular reference
problems.
Here's one way:
#pragma once
class CfrmMain;
class CMyThread
{
CfrmMain *pMainFrame;
};
#include "stdafx.h"
#include "MyThread.h"
#include "frmMain.h"
...
#pragma once
#include "MyThread.h"
class CfrmMain
{
CMyThread *pMyThread;
};
#include "stdafx.h"
#include "frmMain.h"
...
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
I have observed that, when we create an empty class, it takes 1bite space. I don’t know why it takes 1bit space. Will there be any implicit function created when we create an empty class??
Thanks,
Nandu.
|
|
|
|
|
This is using C++/CLI, or are you in the wrong forum ?
I don't see how you can decide that an empty class takes up one byte. One byte where ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: One byte where ?
He said one 'Bite'. Maybe it's an animal class or something.
led mike
|
|
|
|