|
|
|
I'm having a problem using the DataGrid/DataGridView within a MFC dialog (using the CWinFormsControl< > template).
I create a DataSet from a Xml file and then set it to the DataSource. I also set the DataMember to the appropriate table name, but nothing is displayed in the grid view. I tried other various approaches, but nothing seems to work.
I have no problem setting this up in WinForms - it won't work in MFC. I know the data's there because I can actually step right into it from the DataGrid object (debugger) - it just won't display - the ColumnCount is still 0.
What's the problem? Has anyone else experienced this?
|
|
|
|
|
PlayerBalance is a String Data Type
Bet is a Int32 Data Type
I use this Conversation method
Bet = System::Int32::Parse(PlayerBalance); //Its OK
But This code not work; //error C2865: '<' : illegal comparison for handle type
if(Bet < 200)
{
MessageBox:Show("OK");
}
Best Regards...
|
|
|
|
|
Hi,
Int32 is a value class, you probably used ^ there.
Int32 Bet; // should be fine
regards Tobias
|
|
|
|
|
SOLUTION
Bet = System::Int32::Parse(PlayerBalance); OK
if(*Bet > 5) //Must be use *
{
MessageBox::Show("OK");
}
Thank you 2bee
Best Regards....
|
|
|
|
|
How to Create Array of Labels on the Run-Time ?
Best Regards...
|
|
|
|
|
Hello,
if you mean with "Label" a System::Windows::Forms::Label control
then you could use this snippet:
// an array of 10 Labels
array<Label^> myLabelArray = gcnew array<Label^>(10);
regards Tobias
|
|
|
|
|
I try but error occur
error C3149: 'cli::array<type>' : cannot use this type here without a top-level '^'
|
|
|
|
|
Sorry my fault, my thoughts were faster than my fingers:
(I forgot the '^' hat operator which classifies myLabelArray as a reference type)
array<Label^>^ myLabelArray = gcnew array<Label^>(10);
Tobias
|
|
|
|
|
Thanks your help.
array<label^>^ myLabelArray = gcnew array<label^>(10); //Its work But
myLabelArray[0]->Location = Point(100,100); //NOT WORK
|
|
|
|
|
Hi,
maybe my first statement lead you in the wrong direction.
array<Label^>^ myLabelArray = gcnew array<Label^>(10);
This line just creates an array with 10 references of the type Label.
A reference type is implicitly initialized with a nullptr, thus myLabelArray[0]->Location = Point(100,100); will not work unless you initialize it first.
// will work
lab[0] = gcnew Label();
lab[0]->Location = Point(10,10);
You should also use try-catch to catch exceptions that possibly occur.
regards Tobias
|
|
|
|
|
No Error Occur But I Can't See Label on the Form
array<label^>^ myLabelArray = gcnew array<label^>(10);
myLabelArray[0] = gcnew Label();
myLabelArray[0]->AutoSize = true;
myLabelArray[0]->Location = System::Drawing::Point(100, 10);
myLabelArray[0]->Name = L"lblX";
myLabelArray[0]->Size = System::Drawing::Size(63, 13);
myLabelArray[0]->Text = "HELLO";
myLabelArray[0]->TabIndex = 50;
myLabelArray[0]->Visible = true;
Best Regards
|
|
|
|
|
Hi,
you forgot to add the label to the form.
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
array<Label^>^ myLabelArray = gcnew array<Label^>(10);
myLabelArray[0] = gcnew Label();
myLabelArray[0]->AutoSize = true;
myLabelArray[0]->Location = System::Drawing::Point(100, 10);
myLabelArray[0]->Name = L"lblX";
myLabelArray[0]->Size = System::Drawing::Size(63, 13);
myLabelArray[0]->Text = "HELLO";
myLabelArray[0]->TabIndex = 50;
myLabelArray[0]->Visible = true;
this->Controls->Add(myLabelArray[0]);
}
};
regards Tobias
|
|
|
|
|
It's work, thanks a lot 2bee...
|
|
|
|
|
I am not sure if I am posting in the right area, but I am looking for STI resources. I heard that WIA is just a wrapper for STI, however WIA 2.0 doesn't work with older Windows versions. Any C++/C/C# or other .NET supported language resources for STI is what I am seeking. Thanks a lot.
I love to program!
|
|
|
|
|
What are STI and WIA?
- It's easier to make than to correct a mistake.
|
|
|
|
|
STI is still image architecture. It's a way to access digital cameras. WIA is Windows Image Acquisition. It's also another way to access digital cameras. My problem is WIA doesn't work on all operating systems where as TWAIN and STI will. I just need a way to access a digital camera on most operating systems (Windows 98 and above). Also, the digital camera does not mount as a drive or this would be a simple matter.
I love to program!
|
|
|
|
|
**
The following was posted to the .NET foram, but few questions seem to be answered there.
I am no longer mad (upset) just tired. Being .NET seems to go automatically with managed, but one thing at a time.
**
This is driving me nuts!
I am writing my first C++ .NET application and all I want to do is load a bitmap resource. Normally I would do something like ::LoadImage(IDB_BITMAP), but it says it is not in the global namespace. I want to load it as an Image type, but Image only has method for loading from a file or via a windows handle.
The code should look something like the following:
pImage->FromResource(IDB_BITMAP);ORpImage = resources->GetObject(IDB_BITMAP);
This should be simple!
Thanks for any help,
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hello,
i found this article quite useful and it could help you in solving your issue.
However this article shows how to create resources (bitmaps etc.) and use them within a .Net program. I am not quite sure if this is actually what you want. Furthermore it is written in C# but on the other side, C# is easy to convert to C++/CLI.
http://www.jelovic.com/articles/resources_in_visual_studio.htm[^]
so it would be instead:
ResourceManager^ resourceManager = gcnew ResourceManager("MyCompany.MyProject.SomeResources", GetType().Assembly);
Bitmap^ image = (Bitmap^)resourceManager->GetObject ("MyBitmapName");
Hope this helps,
best regards Tobias
|
|
|
|
|
Thank you very much! I do not know if it will help or not (yet), it looks very simular to what I have been tryiing to do. If it is written in C# I can not tell the difference, becuase it looks exactly the same as in C++. If .NET is what the next generation of progammers is going to have to learn, then I feel sorry for them. Actually I should not, since I am now going back to school. But they are making us write everything in vb.net, all pre-packaged stuff (controls, etc...). If I was not tryiing to use .NET and managed code the program would be all but finished by now.
Thanks again,
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi..
I am doing a google call windows application from the console application.
In the console application login in the google a/c and call to a friend is
wroking properly. But in the windows application it is giving socket connection
error i.e. it is giving about 1500 errors which were not in the console application
which has same code.
What is solution to this. If any one know code of logging in to google
please forward it to me.
Help is must.
Rahul Kulkarni
|
|
|
|
|
Hi,
I have installed Visual Studio 2003 and .net framework 2.0.
How can I use .net framework2.0 Toolbox in Design mode?
I only see .net framework1.1 components in Toolbox.
|
|
|
|
|
VS 2003 is incompatible with .NET 2
You need VS 2005.
Regards,
Nish
|
|
|
|
|
hey all,
I am trying to make a program to turn off my computer on a set timer, for when i am burning dvd or listening ot music before bed. Can anyone help me withthe c code to shutdown a computer through a c program.
i know through the command prompt there is a shutdown command:
/shutdown -s
with a [-t XX] XX being the time before the shutdown.
so if there is a way to make my c program use the command prompt, or another way to shutdown the computer, it would be greatly appricated.
Thank you Very much.
- Droz -
___ ___
/\/\ /\ | |
|
|
|
|