|
Are you using C++ or C++/CLI?
and please be more specific in your question.
show us what have you done so far and what problems did you encounter to be able to help you.
|
|
|
|
|
Hello ,
I have three forms and i want to be able to go to the previous form, from forms 2 and 3 can anyone help me with the codes ?
Form2 is called from Form1 and Form3 is called from Form2
debun
|
|
|
|
|
In Form2, call
<br />
Form1->Show(); <br />
do the same with Form3.
P.S: you are in the wrong forum. your question should be asked in the Windows Forms forum.
|
|
|
|
|
I guess I'm going to have to hammer on the message boards until I get this straight in my head. I guess I don't think Germanic enough (throw the cow, over the fence, some hay). This is just as hard as when I was learning MFC, nothing seems to work the way you think it would (or the way you want it to). MFC had edit controls that allowed you to link a variable to the control whether the variable was an int, float, CSting, etc. But there does not seem to be a equivalent control in C++/CLI. Am I supposed to use a textBox control and then convert the string to a numeric? If so, how do you do this conversion? In other words, I have a dialog based application that I want to place a dozen fields on it for the user to enter information. Some of the information will be integers, some will be floating point, and some will be text. What controls would I use to accomplish this?
Thanks
Buck
|
|
|
|
|
I'll leave the Forms stuff to the experts (I still use MFC for UI )...
BuckBrown wrote: use a textBox control and then convert the string to a numeric? If so, how do you do this conversion?
The Sytem::Convert class can do these conversions:
try
{
int textboxint = System::Convert::ToInt32(MyTextBox->Text);
double textboxdouble = System::Convert::ToDouble(MyTextBox->Text);
}
catch (System::OverflowException*)
{
System::Console::WriteLine("Numeric Overflow");
}
catch (System::FormatException*)
{
System::Console::WriteLine("Bad string format");
}
catch (System::ArgumentException*)
{
System::Console::WriteLine("NULL String");
}
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks Mark,
Works good. I have 3 books on begining C++/CLI programming and none of them mention the System::Convert. It's hard to find information on Microsoft's website too (probably because there is just tooooooo much information there. Oh how I miss the days when all you needed was a function reference manual and you just looked in the index. Even if I google 'CLI convert' I can't find any reference to it. If you know of any COMPREHENSIVE books the you could recommend that would be cool. And any book that is basically a C++/CLI function reference manual for the meat and potatoes stuff would be great.
Buck
|
|
|
|
|
I'm still a rookie with .NET. I have a huge base of MFC/Win32 code which only in the last year or
two I've started mixing managed code in places where the .NET classes are easier to use than
straight APIs - XML, WMI, and .NET Remoting (SWEET interprocess communication) come to mind
immediately.
Learning the C++/CLI language stuff - the new C++ enhancements for managed code and mixing
managed and unmanaged code (interop) - was not a huge deal. Easy enough for mixed-mode coding
(although I didn't trust the GC at first ).
But the .NET framework is HUGE. So many namespaces with so many classes - it's growing faster
than I can keep up. I've barely touched any of it. I'm pretty sure the framework has wrapped
everything I've ever done Windows programming, but I still don't know how to find everything
easily.
The .NET SDK is still my most-used source of info. That, and bookmarking any classes or info I
see go by on these boards that I think will be useful in the near future.
I'm curious what's in Nish's new book on C++/CLI!
I'll definitely post here if I run across what I feel is a useful book/resource.
Cheers,
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
BuckBrown wrote: Even if I google 'CLI convert' I can't find any reference to it.
Hi Buck, first when searching for things in the .NET Framework Library there is nothing specific to CLI. CLI is basically a C++ extension for using C++ to develop managed code. Therefore don't use CLI as a key word but instead use 'C#'. Also preface the key words with 'MSDN'. So in the case of your query the search phrase would be:
<br />
MSDN C# Convert string to double
Google Results[^]
led mike
|
|
|
|
|
*hijack* Thanks for the tips led mike! I already use "MSDN2" in my searches but I never thought
to use C#.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am getting my feet wet in Visual Studio 2005 and C++/CLI. I have a ListView that I can sort on each column but I would like to add the sort direction arrows in the column headers and can't seem to find much information on how to do this. Any info at this stage would be helpful.
Thanks
Buck
|
|
|
|
|
|
Thanks, these look like they will give me something to chew on for a while.
Buck
|
|
|
|
|
Hi.
This code based on
Building Browser Helper Objects with Visual Studio 2005
Tony Schreiner, John Sudds
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ietechcol/cols/dnexpie/expie_hello_bho.asp
but i trying to manipulating the dom , with other javascript code. how can i do it,
this is the code ;
Code:
void CUygulama::QPencereGoster(IHTMLDocument2* pDocument)
{
HWND hwnd;
HRESULT hr = m_spWebBrowser->get_HWND((LONG_PTR*)&hwnd);
if (SUCCEEDED(hr))
{
// Javascript goes here
}
}
And this is the javascript
Code:
function popupPage() {
var page = "http://www.webservisidomaini.com/panel.php";
windowprops = "location=no,scrollbars=no,menubars=no,toolbars =no ,resizable=no,width=600 height=300";
window.open(page, "Popup", windowprops);}
how can i implement this js to c++ application. i think this need dom scripting. how can i do this ?
in this sample,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ietechcol/cols/dnexpie/expie_hello_bho.asp
please look for Manipulating the DOM section.
Example BHO code removing images from active web page, now i want to implement other js code, for like this example . How can i do this. any suggestions, resources i 'm looking for.
Thanks
|
|
|
|
|
You should post this in the Visual C++ forum. Anyway, the article you referenced has a section called "Responding to Events". I assume you want your C++ code to respond to the document's onLoad event. First of all, you cannot execute javascript code within a C++ code but you can have C++ invoke the javascript code to execute with in the browser object. Also, you can manipulate the DOM within C++ also. The above article has a section on that called "Manipulating the DOM". You need to study: http://msdn2.microsoft.com/en-us/library/aa752038.aspx[^] and google to areas of interest for examples and information. Also, a good book on DHTML would be helpful.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thanks for reply, I'm studying for Manipulating the DOM you refered, but I trying to understand this.
If I manipulate any javascript to DHTML (correct me if I'm wrong), can I use for invoking on my program ?. Oh. I forgot , I'm developing BHO and I need some javascript implemetations for improving. Any suggestions / advices welcome.
|
|
|
|
|
I'm not sure if this is on the right posting area, but ill ask anyway
I have been making a database program so that i can hold info and other junk that i need.
But when i make it ya know, it doesn't keep it when you close out, i was wondering if there is anyway i can save and load it? or even keep the info in there.
"An eye for an eye makes us all blind." - Gahndi
|
|
|
|
|
You need to give more information. What are you using to update a database? Please give an example of your problem code!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
sorry forgot, here ya go, im not updating, im creating
#include <iostream>
#include <string>
using namespace std;
struct person {
string firstName;
string lastName;
int age;
double height;
};
int menu(int &menuChoice);
void userInfo(person user[], int size, int const track);
void listUser(person user[], int size, int const track);
int main()
{
int menuChoice;
int static track = 0;
person user[50];
do {
menu(menuChoice);
switch(menuChoice) {
case 1:
userInfo(user, 50, track);
track++;
break;
case 2:
listUser(user, 50, track);
break;
}
} while(menuChoice != 3);
return 0;
}
int menu(int &menuChoice)
{
do {
cout << "- Menu -" << endl;
cout << "1 - Enter user and info" << endl;
cout << "2 - List all users and info" << endl;
cout << "3 - Quit" << endl;
cout << "nPlease enter your choice: ";
cin >> menuChoice;
if( menuChoice > 3 || menuChoice < 1) {
cout << "nPlease select an existing option!n" << endl;
}
} while(menuChoice > 3 || menuChoice < 1);
return menuChoice;
}
void userInfo(person user[], int size, int const track)
{
cout << "Enter your first name:";
cin >> user[track].firstName;
cout << "Enter your last name:";
cin >> user[track].lastName;
cout << "Enter your age:";
cin >> user[track].age;
cout << "Enter your height(cm, ex: 150):";
cin >> user[track].height;
return;
}
void listUser(person user[], int size, int const track)
{
int count;
cout << "nnUsers" << endl;
cout << "---------------" << endl;
for(count = 0; count < track; count++) {
cout << "First name: " << user[count].firstName << endl;
cout << "Last Name: " << user[count].lastName << endl;
cout << "Age: " << user[count].age << endl;
cout << "Height: " << user[count].height << "cm" << endl;
cout << "---------------nn" << endl;
}
return;
}
"An eye for an eye makes us all blind." - Gahndi
|
|
|
|
|
You need to write code to save your data to the hard drive or some other resource such as a database. However, there is no simple answer on how you should save your data from memory and recovering it from an resource. If you are just creating a personal database used only by you, you still have to consider what are your immediate and future requirements. You have a primitive interface to insert records and to sequentially list them. If that is all the functionality you need, then saving your records to a comma separated file may be all that you need. You can use the Standard Library's file streams to do this. To access the file streams, you need to have: #include <fstream>. You can google the web to find examples on how to use the file streams: http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=73&rl=1[^]
By the way, you are in the wrong forum. You should be in the Visual C++ forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
1) I need code written by some body else for string concatenation without using sting functions?
2)Taking the variables from string in alphabatic order.
For example:
we r entering a word called MARK.It has to print in alphabatic order ie: MARK as AKMR.
3)write a program for printing in between numbers (Ex: 3,4,9,7,10,14,54,8) print the numbers existing inbetween 3 and 8.
|
|
|
|
|
If you have written some code, please ask a specific question concerning that code. A sample of your coding problem is always helpful.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
i need one example program code.......
|
|
|
|
|
I am sorry. You won't get that kind of help here. A simple string in C++ is an array of characters terminated by a NULL character. You need to write your program to operate on that array probably using pointers. So, crack open a C++ primer and get to work.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I want string programs in c++ without using string functions
1)write a program for string concatenation without using string concatenation function.
2)Taking the variables from string in alphabatic order.
|
|
|
|
|
Are you required to use Managed C++ for this? If not, you should post your question on the
VisualC++/MFC[^] board.
Hamsika rani wrote: 1)write a program for string concatenation without using string concatenation function.
Have you written some code you need help with or do you need someone to write it for you?
Hamsika rani wrote: 2)Taking the variables from string in alphabatic order.
What is a variable in a string?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|