|
Yes. Although Message Box only takes string prarameters, you can always put variables into the string you're going to display. For example,
char str[256];
for (i=0;i<2;i++)
{
sprintf(str, "The variable is: %d", i);
MessageBox(str, ...);
}
Note this is just native C code.
Best,
Jun
|
|
|
|
|
CString str;
for(i=0;i<2;i++)
{
str.Format("%d",i);
MessageBox(str);
}
Nagaraju
|
|
|
|
|
Hi All,
I've just switched my project from old VS6 to VS.NET 2005.
At compile time, I receive a lots of warning about 'deprecated' functions . Some of them have been disabled using _CRT_SECURE_NO_DEPRECATE. Others are still there.
I would like to use #pragma warning(disable : 4996) without using _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES to override functions with their secure version.
Files are too much to write in each of them: do you know if it is possible to set some projecet settings, or a place where to inserte a single #pragma so that it is valid for all files?
Regards
Manu
|
|
|
|
|
|
..sometimes, life can be very easy!!
Many thanks Earl!
Have a nice day.
Manu
|
|
|
|
|
Hi all..
Can anyone tell me the procedure to follow to connect to a database(Of MySQL Server).Is there any link where i can find some useful information on this topic.
Thanks in advance,
Veenu
|
|
|
|
|
See Here.[^]
I hope this helps
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
So can you provide me with some info about "connecting to database " so that it will become a bit easy for me
regards,
veenu
|
|
|
|
|
What exactly from the article didn't work for you?
earl
|
|
|
|
|
Hi,
I have an unmanged c++ dll and need to write a c# wrapper for it so I can add it to my c# application
I have this in c++
extern "C" BOOL WINAPI GetDeviceID(DWORD dwDevice, DWORD* pdwID);
and in my wrapper I have
[DllImport("MDBEngine.dll")]
unsafe public static extern bool GetDeviceID(uint dwDevice, uint* pdwID);
my question is what is the * for in c++ and do I need it in my reference in c#?
|
|
|
|
|
That is a unmanaged pointer. You must marshal your corrsponding C++/CLI varaible to an appropriate native pointer before using this platform invoke.
Best,
Jun
|
|
|
|
|
Hi
You can use from SWIG (Simplified Wrapper and Interface Generator).SWIG is an interface compiler that connects programs written in C and C++ with scripting languages such as Perl, Python, Ruby,C# and Tcl. It works by taking the declarations found in C/C++ header files and using them to generate the wrapper code that scripting languages need to access the underlying C/C++ code. In addition, SWIG provides a variety of customization features that let you tailor the wrapping process to suit your application.
http://www.swig.org/
-- modified at 5:55 Monday 10th July, 2006
|
|
|
|
|
hi i want to write an application just like PC any where.just confused where to start. i had couple of ideas.
on is that capture the screen as bitmap and send it to another computer that will show it to the user.but dont know where the user had clicked on static bitmap and get all pts.any idea is welcomed.
Second is that on clicking on one PC how to generate that event to another computer. any API etc.
Tasleem Arif
|
|
|
|
|
Actually I am facing the problem that I am not being able to use the class templates in managed c++.net code.But the unmanaged code uses the templates.Is there a way out in the dot net to use the class templates in managed c++ code.
Is there a way out.
Thanks.
|
|
|
|
|
What's the problem that you are facing using templates in .NET ?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Dear sir,
I am facing the problem that I am not being able to use the templates in managed c++.net code.But the unmanaged code uses the templates.Is there a way out in the .net to use the templates in managed c++ code.
There is also one more problem that in my unmanaged c++code i have been using the multiple inheritance and multiple inheritance is not supported in managed c++ .net.And If I use the interfaces then the interfaces don't contain data.Is there a way out.
Thanks.
|
|
|
|
|
Hello!
I need to send a structure via TCP/IP withuot using serialization!
since the other side is unknown i cant use this feature.
thanks
|
|
|
|
|
say what?!?! can you try and explain your problem a little bit. What do you mean by the other side is unknown? And, which part of sending over TCP/IP don't you understand?
Please, be a little more specific about what you are trying to accomplish. It will help us give you the right answer.
----
www.digitalGetto.com
|
|
|
|
|
U right
What I need to do is this:
Take a structure and send over a TCP/IP to a client/server on the other side.
The problem:
I need to transform the structure to an array of bytes which I don’t know how.
I can't do this with the serialize function since the other side may or may not have the unserialize function.
I tried to do this with casting but it didn’t work.
I tried to do this with union' but u can't make an array inside a structure.
I tried to do it whit unmanaged code, but the Socket class will accept only managed Byte array.
There, I told u all I know. Can u help me?
|
|
|
|
|
|
The structure that you are trying to send.. is that something you made?
Is the receiving end a program that you're writing? If not, what format does it expect the data to be in?
Serialization/Deserialization is a process. That's all. There is nothing magic involved. You can always write your own functions to serialize and deserialize data. Here's an example of a simple structure that is serialized into a byte array:
struct myStruct
{
int iValue;
string strValue;
public myStruct(byte[] sourceArray)
{
int k;
if(sourceArray.Length > 2)
{
this.iValue = sourceArray[0] + sourceArray[1] * 256;
this.strValue = "";
k = 2;
while(sourceArray[k]!=0 && k<sourceArray.Length)
this.strValue += (char)sourceArray[k++];
}
}
public byte[] Serialize()
{
int k;
byte[] tmpArray = new byte[2 + this.strValue.Length];
tmpArray[0] = this.iValue & 0xFF;
tmpArray[1] = (this.iValue >> 8) & 0xFF;
k = 0;
while(k < this.strValue.Length)
tmpArray[k + 2] = this.strValue.ToCharArray()[k++];
return tmpArray;
}
}
byte[] t;
myStruct A;
myStruct B;
A = new myStruct();
A.iValue = 567;
A.strValue = "test string";
t = A.Serialize();
B = new myStruct(t);
obviously, once you serialize your structure into an array you can send it over TCP/IP using a WinSock
----
www.digitalGetto.com
|
|
|
|
|
First of all, thank u all!!!
Let me tell u the all story.
What I need to do is to send a message over the net.
So, I have this structure (which is the message to be sent), and then I have to send it (somehow…)
Then, I receive a message which I have to decode and then, according to the header, I parse it back to a structure which I will use in the program.
I know that for some of u readers it may seem like a dumb question, but since it is my first time that I have to deal with communication, please accept my ignorance.
Much appreciated
|
|
|
|
|
What is your question exactly, how to send/receive data via TCP/IP, or how to encode/decode your data?
If it is the former, start from here.
Best,
Jun
|
|
|
|
|
If u put it this way, then, it is how to encode and decode the data.
But remembering that I can’t use the serialization option that .net gives me.
Meaning, converting a structure to a Byte array and the other way around.
|
|
|
|
|
Hi
Actually I am facing the problem that I am not being able to use the templates in managed c++.net code.But the unmanaged code uses the templates.Is there a way out in the dot net to use the templates in managed c++ code.
There is also one more problem that in my unmanaged c++code i have been using the multiple inheritance and multiple inheritance is not supported in managed c++ .net.And If I use the interfaces then the interfaces don't contain data.Is there a way out.
Thanks.
hy
|
|
|
|