|
To add to what Mike says, the objects that you add to the hash table are also managed objects, and thus garbage collected.
If you add unmanaged pointers to the hashtable, you'd have to manually delete the native objects that are pointed to by those pointers.
|
|
|
|
|
I want to use graphic header in visual c++
but it's not possible.
please help me.
great tanks to you.
Bye.
MK4
-- modified at 16:04 Thursday 5th January, 2006
|
|
|
|
|
In what way is it not possible? Do you mean it's not available? If so, there's nothing you can do about it. On the other hand, if you copied it from a Borland C++ installation, and it's not compiling, then you might have to change the Borland specific macros/code to use Microsoft specific or generic syntax.
|
|
|
|
|
Hi
tanks for ur answer
i want to compile some programs used the graphics.h with visual C++ 6.
and i don't know about how the graphics.h works to change it.
please help me.
bye.
MK4
-- modified at 1:49 Saturday 7th January, 2006
|
|
|
|
|
if you have the TC2 graphic.h headers and libs you should able to compile it with VC1.5 ...
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
|
This question should be posted in the Visual C++[^] forum. This is the C++/CLI forum that's dedicated to the new managed and mixed-mode compiler available in VC++ 2005.
|
|
|
|
|
Will Do.
Thanks Much!
T.J. Barbour
|
|
|
|
|
Hi guys
I've seen some articles talking about CFileDialog with preview and the CFileDialog resource is bigger than the usual CFileDialog. I read about "template dialog" but I don't know how this stuff is implemented.
What is the procedure to do a custom "CFiledialog" resource?
Thanks and Happy New Year
Doc
|
|
|
|
|
This question should be posted in the Visual C++[^] forum. This is the C++/CLI forum that's dedicated to the new managed and mixed-mode compiler available in VC++ 2005.
|
|
|
|
|
Sorry
|
|
|
|
|
is it possible to publish my cpp program code in this website ? does the code have to meet some specifications/standard ? how do i submit it ?
|
|
|
|
|
thekeralite wrote: is it possible to publish my cpp program code in this website ? does the code have to meet some specifications/standard ? how do i submit it ?
Please see our Submission Guidelines[^]
|
|
|
|
|
Hello,
I am making a windowed application and need the program to sit in a loop waiting to receive messages. I am having some trouble with the thread. Here is the code I have now...
Form1 * messageThread;
messageThread = new Form1;
ThreadStart * pThread = new ThreadStart(messageThread, &Form1::messageLoop);
Thread *oThread = new Thread(pThread);
oThread->Start();
This code compiles fine, but I don't think it works correctly. This is my first experience with threads, so I would appreciate any input. This code is executed when a button is clicked. I want it to call the messageLoop function, which is in Form1. When the thread receives a message, I want it to output it to the gui - but it does not do this. Any thoughts?
Roy K
|
|
|
|
|
|
Is it possible to create a thread in the class of the function that you want to call? That sounds confusing... I want to create a thread in my Form1 class so it can call the messageLoop function, which is in the Form1 class. I thought that is what this code did,
Form1 * messageThread;
messageThread = new Form1;
ThreadStart * pThread = new ThreadStart(messageThread, &Form1::messageLoop);
Thread *oThread = new Thread(pThread);
oThread->Start();
but i was wrong...
-- modified at 18:08 Tuesday 3rd January, 2006
Scratch that...stupid mistake
the code should look like the following if I wanted a change to be visible on the gui...
ThreadStart * pThread = new ThreadStart(this, &Form1::messageLoop);
Thread *oThread = new Thread(pThread);
oThread->Start();
I used the current class instance ('this') instead of creating a new class instance. This showed the changes to the gui that was running.
thanks for the help
|
|
|
|
|
// CR - carriage return
// LF - line feed
// In "cpp.properties", any new line is set as CRLF, but when the text document has been written to "bbb.txt", CRCRLF appears in "bbb.txt" instead of CRLF. Can anyone please tell me where the problem lies in?
#include <iostream>
#include <fstream>
#include <windows.h>
typedef unsigned short int usint;
int main(usint arg, char *parameter[]) {
if (arg == 2) {
using namespace std;
ifstream::pos_type size;
char *memblock;
const char *convert;
string search = "command.build.*.cpp=M:/Dev-Cpp/bin/g++.exe -o \"$(FileName)\" \"$(FileName).$(FileExt)\"";
string link_file = " -Xlinker ";
link_file += parameter[1];
string filebuffer;
ifstream readfile ("M:/SciTE/cpp.properties", ios::in|ios::binary|ios::ate);
if (readfile.is_open()) {
size = readfile.tellg();
memblock = new char [size];
readfile.seekg (0, ios::beg);
readfile.read (memblock, size);
readfile.close();
filebuffer = memblock;
delete []memblock;
filebuffer.insert((filebuffer.find(search, 0) + 93), link_file);
ofstream writefile("M:/bbb.txt");
if (writefile.is_open()) {
writefile << filebuffer;
writefile.close();
system("M:/bbb.txt");
}
else {
MessageBox (NULL, "Unable to WRITE file.", "ERROR", MB_OK);
goto end;
}
}
else {
MessageBox (NULL, "Unable to READ file.", "ERROR", MB_OK);
goto end;
}
end: return 0;
}
}
-- modified at 20:50 Monday 2nd January, 2006
|
|
|
|
|
This question should be posted in the Visual C++[^] forum. This is the C++/CLI forum that's dedicated to the new managed and mixed-mode compiler available in VC++ 2005.
|
|
|
|
|
|
I would like to use Win API's SendMessage( wnd, WM_GETTEXTLENGTH, 0, 0 );, or PostMessage function to be able to get the text from the textbox of another program. Let's say, I would like to be able to get the text from Instant Messenger and show it in my App. Does anyone know how to do this!
I'm doing it in C#, but I'm posting here because those functions are not C# native and you are more familiar with them than C# programmers.
|
|
|
|
|
In C++, you only need to include the required head file and call the API. In other languages like VB/C#, you need to use P/Invoke. Read up on using P/Invoke with VB/C# and you should be able to figure out how to do it.
|
|
|
|
|
Hi,
I have 2 LAN's and both have diffrent ip classes. On both networks people use to chat on same software. but i cann't run that software for both networks.
how can i run 2 copies of same software.
|
|
|
|
|
Your question is not very clear. And in any case, this is not the correct forum for such questions. This should be posted in the Visual C++[^] forum. This is the C++/CLI forum that's dedicated to the new managed and mixed-mode compiler available in VC++ 2005.
|
|
|
|
|
I am trying to convert a program from C++ to MC++ and it uses the following type of class arrays. Can someone show me how I would convert this tp MC++.
Thanks in advance for your help.
GlobalVariables.cpp
#include CData
CData Data[100][10];
CData.h
CData Data
{
deque<float> data1;
int data2[20];
}
CData.cpp
x = Data[10][10].data1[1]+Data[10][10].data2[4];
|
|
|
|
|
I presume that you are using VC++ 2003. If that's correct, see my article on using arrays in MC++
Using managed arrays[^]
But, if you are using VC++ 2005 and the new C++/CLI syntax, see my C++/CLI article :-
Arrays in C++/CLI[^]
|
|
|
|