|
|
I'm glad you got your answer, but please don't post C questions in the C++/CLI forum in future.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
tell me about void in c language
|
|
|
|
|
you should be more specific.
Generally, void is used in functions.
1)If the function does not return any value,ex:
<br />
void Print_Numbers (int i)<br />
{<br />
for (i;i<100;i++)<br />
cout<<i;<br />
}<br />
When you call the above function, you should send an integer parameter,say n, and the function will print the values from n to 1000. No return type is needed, that is, void will be set as a return value.
2)You can have the parameter also to be void instead of (i). In this case you should initialize the variable i inside the function.
I hope this is what are you looking for,
|
|
|
|
|
thanks for ur response....
but i need significance of "void"
|
|
|
|
|
|
Void: The total absents of anything.
1) If void it the return type, then the function returns nothing.
2) If void is an argument to a function, then the function takes no arguments.
3) If you convert a pointer to a variable to a pointer to void, it means that only you (normally) know what type it origanaly was. Very handy for passing around indirect references (pointers) to types, but dangrous if the reciever converts it to a variable type other than the original type. By the way most modern operating systems depend on this ability, because message passing requires the ability to pass references (actually indirect references) around.
It is that simple.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
could anyone help me with the projrct on streamline allocation i.e i need a complete coding for this project.actually in this C++ program i have to allocate marks to students on the basis of their performance in exams
|
|
|
|
|
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
|
|
|
|