|
Please,
How create a Printer Port Monitor??
I need to create this.
Please help me!!!
raf-sp
|
|
|
|
|
I am using Visual Studio.Net 2003B and I have to say that i am really pleased with
the Studio's Form Designer...It really helps you handle the events ,the properties and many other things.
BUT I have some problems with the organisation of the Forms the Designer proposes(or is it forces you..?).
It implements a form as a Form.h library file and a main CppForm for example .cpp file which calls the
Forms class at the beginning.
Application::Run(new Form1());
Let's say i create a second form using Studio's Wizard,Add New Item->Windows Form.
That means a second Form2.h and a Form2.cpp is created.
What i want to do is by clicking a button at the Form1 to Show Form2..
How do I do that.
Does it have anything to do with PArent and Child Forms?
I found the following code for Child and Parent Forms but the problem is i want to
put this code into the Form1.h event handler for my button..
private:
void CreateMyChildForm ()
{
// Create a new form to represent the child form.
Form* child = new Form();
// Increment the private child count.
childCount++;
// Set the text of the child form using the count of child forms.
String* formText = String::Format( S"Child {0}", __box(childCount));
child->Text = formText;
// Make the new form a child form.
child->MdiParent = this;
// Display the child form.
child->Show();
}
If i want to fire a new instance of Form2 class how would i do it as far as the event handler of Button1 let's say
is in Form1.h and cannot "see" the Form2 class located in Form2.h..
PLS HELP
May it be your fate to live in interesting times
|
|
|
|
|
int APIENTRY _tWinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance,<br />
LPTSTR lpCmdLine,<br />
int nCmdShow)
Why's it called _tWinMain, instead of WinMain? What does APIENTRY do?
-------------------------------------------
int __stdcall WinMain(int argc, char* argv[])
If __stdcall is to call Win32 API, why can't I use:
int _stdcall WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
--------------------------------------------
When to use which? What are the differences between these two Main function?
Thanks
|
|
|
|
|
|
I am having problems launching MS Word from my code (Visual C++ .net).
I do not need to link to the data in any way - just launch Word with a specified document
|
|
|
|
|
read the FAQ, under 'shellexecute'.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi guys I am working on K-means algorithm.If anyone can help me by sending the source code for K-means algorithm for clustering i"ll be very very grateful.thanks a lot.
Help required on clustering
|
|
|
|
|
Hi,
I am a completly new to .NET.
I have a managed .NET DLL that I need to use with some of my C++ code.
My understanding is that all the information (.lib .h) is contained within this .Net DLL and that it is all I need.
How do I incorporate this into my solution, reference the calls and link successfully?
First, Can I do this and second, how do I go about doing it?
Thanks for you help
Phil
|
|
|
|
|
Yes, in all probabliity, you can call managed code from an unmanaged application; this is what Interop is all about.
Are you using the Visual C++ .NET compiler? If so, you can launch the IL Disassembler and examine the .NET DLL and all of it's metedata.
Try reading this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconInteroperatingWithUnmanagedCode.asp[^]
To be perfectly honest with you, my experience is exclusively in using unmanaged COM within a managed .NET application, so I am unfamiliar with the techniques for using .NET from native C++, but, I know it can be done.
If you can get a copy of Adam Nathan's book, "NET and COM: The Complete Interoperability Guide", read it. It describes the techniques necessary.
|
|
|
|
|
Ursus, thank you for your response.
I still haven't got it.
If, I was using a regular "com" dll with unmanaged c++ I would expect to have a header file and a lib. That would provide all the prototype and typing that I would need to use a class and function.
What I have is a managed .Net.dll. Now, this is supposed to contain all the information my app needs, however I can’ seem to get it to work.
I have:
compiled my managed code with a “#using "Mscorlib.dll" and a “/clr” option so I am using the common runtime.
Done a “#using "IRTrans.NET.dll"
And generally played around with every combination I can think of
But I can’t get it to even recognize:
ClassName variable;
I get undeclared identifier of both the ClassName and on the variable.
Any and all help would be greatly appreciated
Beer.
|
|
|
|
|
BeerFizz,
Sorry, I didn't respond, holiday vacation.
On reading your second message, I too am mystified.
If you compiled your code with the /clr compiler option, then you have created a managed application. If you pasted the DLL into your project directory, the compiler should be referencing it and your Intellisense would be showing you the way.
Did you open the DLL with the IL Disassembler? This is a terrific utility, and it will give you access to all metadata (which is exactly what your compiler does), and you can read through the entire DLL. The DLLs often have a namespace associated with the types defined in the library, and you will have to add a 'using namespace whatever' directive in your code.
Then you merely instantiate the objects you need using the new operator, assigning this to a pointer in your own code. To then call functions and data members of the object, you use the pointer-to-member operator (->).
Once you have instantiated an object, Intellisense should show you all the data and function members available.
It's supposed to be pretty simple.
|
|
|
|
|
The following code compiles fine with Linux g++ compiler but in Visual .Net
generates errors: C2057: expected constant expression
void Sample2(int lenght)
{
char tab[lenght+1]; //C2057
}
void Sample(int lenght)
{
const int size = lenght+1;
char tab[size]; //C2057 ???
}
Is it imposible to declare arrays in function without using new opperator?
Toximus
|
|
|
|
|
I thought you need to use new. You certainly should be asking in the C++ forum.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
There are four guys trying to get home at night and in order to do so, they MUST cross a bridge. It's very dark and there is only one torch available. The bridge can ONLY support "TWO" person at a time. Now, a bomb has been set on the bridge which will explode in 18 mins. Due to the fact that each person's travelling speeds are different, therefore some will obviously take longer to cross than others.
The time that each person takes are as followed:
A = 1 min
B = 2 min
C = 5 min
D = 10 min
Torch = 1 Qty
Here's how it works: If D & A goes first, it'll require 10 mins for them to cross the bridge together. By the time A gets back with the torch to B&C...11 mins will be passed already.
The total time required is : 17 mins
the solution to it is:
A and B first - 2 minutes (max 2 )
A runs back with torch = 3 minutes
C and D Next = 13 minutes ( max 10 )
B comes back with the torch = 15 minutes ( max 5 )
A and B again = 17 minutes
Can anyone tell me the code to this problem in turbo c or vc urgent please. many many thanks in advance.
Babur Khan
|
|
|
|
|
If you tell me the email of your teacher, I'll forward your question there.
|
|
|
|
|
hi everyone
can n e one send me a simple code of creating a server (creating socket, binding, listening, accepting connection ). i need the statements that do it. it wouldn't be hard for guys around here. Code should be in VC .NET
thanx in advance.
Rashid
|
|
|
|
|
When a user types in a sentance, and i want to seperate each word, how do i do i do that. I need to get each word seperatly.
|
|
|
|
|
Frustration!
I am trying to assign the value of a character array ( of type char my_array[99];) to a combo box but am just getting cryptic messages about boxing and __gc / __value.
I know that this should be very simple, I have found many examples using comboBox1->Items->Add(S"some text") but cannot seem to get it to use the contents of my variables
I am using Visual C++ .net
Please help, not much hair left!
-- This is a re-posting, Incorectly posted on the C++ board
|
|
|
|
|
This is really, like you guessed, a simple thing.
You're using Visual C++ .NET, probably to compile a Managed Application, and you've declared a simple char [] array to use with .NET objects and methods.
We all make a similar mistake when first writing a managed app: the char [] is a user-defined type. It is not a CLR type. This means that your char [] is an unmanaged type, and as a consequence, all .NET (I'm oversimplifying here) types and their methods will find this type incompatible, and the compiler will produce error messages.
The cryptic __gc message just tells you to use the "__gc" keyword (this is a Microsoft-specific language keyword) that indicates that the type following is a managed type (garbage collected).
Read this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmxspec/html/vcManagedExtensionsSpec_4_5.asp[^]
You might find this CodeProject article even more helpful:
http://www.codeproject.com/managedcpp/csarrays01.asp[^]
|
|
|
|
|
Thanks for this (I think!)
I have 'hacked' a work around.
I have used an invisible text box
Added my array contents to this
Then used the contents of the text box
I think this is very messy but at least it works
If anyone is interested I will post the work around
Merry Christmas
|
|
|
|
|
Please can some tell me what are the header files required to write a basic C++ and Oracle programme. A sample code would help a lot.
Every is Illusion
|
|
|
|
|
What does this have to do with MC++ ?
There are no headers, you just need a driver for Oracle and ADO.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Anyone know how I would do this? I would think it's something like...
<br />
int myNum = 7424;<br />
String * myNumAsHex = Convert::ToString(myNum, "X");<br />
That doesn't work of course because I think you need to use the IFormatProvider class but I can't seem to use it correctly, any ideas?
|
|
|
|
|
I think you can finish it as the following:
int nNum = 7424;
char szNum[20];
sprintf(szNum, "%x", nNum);
Coding,I love it! MM,I Love it 2!!
|
|
|
|
|
itoa() with radix parameter set 16 will convert to HEX string
See details of itoa()
|
|
|
|