|
I am not sure you can do that because CString is implemented very different in VC++7 than VC++6.
John
|
|
|
|
|
What's the Exception?
- monrobot13
|
|
|
|
|
The following text appears in the Exception dialog:
An unhandled exception of type 'System.NullReferenceException' occurred in MyDll.dll
Additional information: Object reference not set to an instance of an object.
|
|
|
|
|
Hi rkvs.
If VC6's CString and VC7's CString class are different, then you can't pass it as a class (reference). because they are quite different classes, just their names are same.
so you'd better pass it char* data type.
I guess both of CString classes has (LPCSTR) casting operator.
Have a good day~
- taeho -
|
|
|
|
|
Hi All,
I'm the first to admit that I'm not to good at the design aspect of programming. So first I was wondering if anyone had any good suggestions on books that I could read that would help out with this topic. All comments are appreciated.
Second, I have a design question. I'm currently writing a program that uses a tabcontrol and I'd like end user to be able to dynamically add/remove/insert tabs into the program, now the problem is I'm not sure of the best way to implement this. I did design one version that used a checked listbox (in an options form) to allow the user to add/remove/insert "items", when the user clicked ok I would check what "items" had a check and create the tabs for them. Where I ran into a problem was that even items without a check need to be kept in memory so that when the user opens the options again they are still there (and it they check them they should be created, and vice versa) the other problem is that each tab has to have some data associated with it. What I did in the first design was have an array that I threw back and forth between the two forms, but that proved to be a very poor design. I'm just wondering if anyone has any better design that I could try I would really love to hear it. Any ideas or simple things to try would be extremely appreciated.
Thanks All!
- monrobot13
|
|
|
|
|
I am using Borland 5.02 version
but i can't find the way to include BGI file
for using graphics.
Please tell me the way to include this.
Thanks.
|
|
|
|
|
You should probably ask this in the Visual C++ forum because Managed C++ is a .NET language in which C++ code is executed in a virtual machine. It will allow you to mix C++ code with VB.NET, C#.NET and other .NET languages and run in the same environment. At one time I actually knew the answer to your question but that was before I did windows programming...
John
|
|
|
|
|
|
Hi,
I'm trying to produce output like this: XXXXXXX
XXXXX
XXX
X
This is what I have so far and just wondering if I am on the right track.
#include <iostream>
#include <stdio>
using namespace std;
int main()
{
int i = 1;
int j;
cout << "How Big? ";
cin >> j;
//getchar();
for (j >= 1; j <= 7; j = j + 1)
{
for (j >= 1; j <= i; j = j + 2)
{
cout << "X";
}
cout << "\n";
}
}
I just wanted to know if I was on the right track. Thanks.
|
|
|
|
|
since you are using stl, I suggest using
basic_ios::fill
|
|
|
|
|
Is there an equivalent MC++ function to the C# one in the subject?
Thanks,
- monrobot13
|
|
|
|
|
String::Format()
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
String::Format()
The problem with that is there isn't an overload that will take n number of parameters (at least not one I can find). So if I try to do this:
str = String::Format ("{0}{1}{2}{3}", str1, str2, str3, str4); I get an error that there is no overload of String::Format that takes five parameters.
Any idea how I can get around this?
Thanks in advance.
|
|
|
|
|
Just wrap it in a Object* __gc[]
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
Just wrap it in a Object* __gc[]
I was hoping it wouldn't come to that, but I guess that's what I'll have to do.
Thanks!
-monrobot13
|
|
|
|
|
monrobot13 wrote:
I was hoping it wouldn't come to that,
Why?
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
Why?
Because I'm not sure how to declare an array like that. I tried doing this, but it didn't work:
Object* strs[] = new Object* {S"Time ", msg.ToString ()}; If you could post how I should actually be declaring this array it would be appreciated. I was able to get it working with this code:
Object* strs[] = new Object* [2];
strs[0] = S"Time ";
strs[1] = msg.ToString (); But I prefer declaring it all in one line as it looks cleaner.
- monrobot13
|
|
|
|
|
Object* str __gc[] = new Object*[]{S"Time",msg};
That should work, try some combos
<a TITLE="See my user info" href=http:
|
|
|
|
|
Got it working. Thank you very much for the help!
- monrobot13
|
|
|
|
|
Hello,
Does .NET have namespaces or functions for working on I/O devices ?
For example LPT or COM port ?
Regards,
|
|
|
|
|
|
Thanks for reply
|
|
|
|
|
Can you guys give me the basic simple code you need for a simple shape to move or rotate? I asked my teacher to help me because I want to get into c++ but he won't and I just don't get the book explanations. All I need is a basic short code that will work and make a shape rotate and understand how it all works and I can work with what the book tells me. Thanks SO MUCH.
|
|
|
|
|
We need way more information to answer this question. C++ has no built in graphics so what platform are you using? MFC, WIN32 API, DirectX ...
Are the shapes 2d or 3d?
Also this is the forum for managed C++ which is probably not what you want.
John
|
|
|
|
|
Hi all,
I've just started to do some programming in MC++. I'm trying to use the string class, but I'm running into a problem whenever I try to concat strings. I'm using the + operator, but I always get "error C2845: '+' : cannot perform pointer arithmetic on __gc pointer 'System::String __gc *'. Now to the best of my knowledge (which is little in MC++) you have to declare variables as pointers when using reference types.
Is it possible to use the + operator to concat strings or must you use the Concat function?
As well how do you subscribe to an event? I've tried this code:
m_time->Elapsed += new ElapsedEventHandler (OnTimer); but receive "error C3350: 'System::Timers::ElapsedEventHandler' : a delegate constructor expects two arguments. This is how I did it in C# so I'm not sure what I'm missing here.
One last question: What's the equivalent of null ? I've tried using null in this way m_szUser != null , but receive an error that "null" is an undeclared identifier
Any and all help is very much appreciated.
- monrobot13
|
|
|
|