|
This is standard C++. You're in the C++/CLI forum, try the visual C++ forum.
If terms is an int, I believe it will keep asking until you enter an int value. Or you can accept a std::string and try to parse it yourself and give custom errors. Things like atoi will help here.
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 )
|
|
|
|
|
Hi,
How can i access filesystem within c++?
Can i use standard C functions? Like chdir, etc?
Thx,
Nuno
|
|
|
|
|
If you are looking for native code, please ask this in the Visual C++ forum. Else take a look at the classes in the System.IO namespace.
Regards,
Nish
Fly on your way like an eagle
Fly as high as the sun
On your wings like an eagle
Fly and touch the sun
|
|
|
|
|
;PNow i have lots of text files in a folder,i want to combine them into one large file,but the problem is that it is must be order the formation rule.
for instance:(the txt file order)
the first text file list item"1c.txt,2c.txt,.........
the second text file list item"1e.txt,2e.txt,........
now the combine file order must be "1c.txt,1e.txt,2c.txt,2e.txt........."
and so on!
Waiting for ur help!
Thx advance!;P
初学者!Don't try it, just do it!
*Archibald*rever dragon!
|
|
|
|
|
Hi,
I am new to vc++.net (mfc),i need to know how to add data and column headers to the MSDATAGRID VERSION 6.0 dynamically IN vc++.Net(mfc application), Please someone help me.
I have taken an sdi(mfc application) and added a MS DataGtrid, now i need to add column headers and data to the grid.The code i added to write is
m_DataGrid1.put_Row(1);
m_DataGrid1.put_Col(1);
m_DataGrid1.put_Text("Nit");
the error i got is "rowset not available".
Thanks in advance
Engilela
|
|
|
|
|
Hi,
I have used MS HEIRARCHICAl FLEX GRID
//code to add row by row to a grid
m_FlexGrid.put_Cols(0,6); // number of columns(5)
m_FlexGrid.put_ColHeader(0,1); //setting the header
m_FlexGrid.put_ColWidth(1,0,1300); //col width
m_FlexGrid.put_ColWidth(2,0,1000);
m_FlexGrid.put_ColWidth(3,0,1400);
m_FlexGrid.put_ColWidth(4,0,1500);
m_FlexGrid.put_ColWidth(5,0,1200);
m_FlexGrid.put_ColHeaderCaption(0,1,"Employee Name");//adding //captions to the header
m_FlexGrid.put_ColHeaderCaption(0,2,"Employee ID");
m_FlexGrid.put_ColHeaderCaption(0,3,"Employee Salary");
m_FlexGrid.put_ColHeaderCaption(0,4,"Employee Address");
m_FlexGrid.put_ColHeaderCaption(0,5,"Employee Age");
m_pSet->MoveFirst();
int RowCount=0;
while (!m_pSet->IsEOF())
{
RowCount++;
m_pSet->MoveNext();
}
m_FlexGrid.put_Rows(RowCount+1);
m_pSet->MoveFirst();
int Row=1;
int Col=1;
while (!m_pSet->IsEOF())
{
m_FlexGrid.put_Row(Row);
m_FlexGrid.put_Col(Col++);
m_FlexGrid.put_Text(m_pSet->m_EmpName);
m_FlexGrid.put_Col(Col++);
long var=m_pSet->m_EmpID;
CString str;
str.Format("%d", var);//to convert long to string
m_FlexGrid.put_Text((LPCTSTR) str);
m_FlexGrid.put_Col(Col++);
double var1;
var1=m_pSet->m_EmpSalary;
str.Format("%0.2f",var1);
m_FlexGrid.put_Text((LPCTSTR) str);
m_FlexGrid.put_Col(Col++);
m_FlexGrid.put_Text(m_pSet->m_EmpAddress);
m_FlexGrid.put_Col(Col++);
var=m_pSet->m_EmpAge;
str.Format("%d",var);
m_FlexGrid.put_Text((LPCTSTR)str );
Row++;
Col=1;
m_pSet->MoveNext();
}
I am sending this so that, it may be useful to someone
Engilela
|
|
|
|
|
Salam,
hi friends i am having a big ptoblem in my project hope i iwll get help here..
lets discuss it
PROBLEM
I want to connect a mobile with my PC such that the sms i recieve is redirect to my PC via connecting cable IR or bluetooth. the main aim is to recieve the message as a varibale in my ptogram i will give example
like i recieved the sms written "hello world"
and the coding use that string and store it in the variable declared such that
char sms= "hello world"
plzzzzzz reply if u know how to store that string as variable
shahensha
|
|
|
|
|
Well, if you're using C++/CLI, you can do String ^ = "hello world". Your overall question makes me think that you're pretty lost, and probably taking on a project that's too hard for your skill level. So, you may also be confused about what this forum is for. It's for .NET C++, not C++ in general. The visual C++ forum is for that.
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 )
|
|
|
|
|
|
Sushant,
We are here to help you solve a specific programming program not to help you write the whole application or, worst yet, write the whole application. If you need some ideas, please search the web with Google with the key words such as "8-puzzle game programming AI".
Geo
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
You should do your own homework.
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 )
|
|
|
|
|
hello
I looking for a script that can index a folder.
I'm working with borland C++ 6.0.
Great,
Marc
1 day, 24 hours, 1440 minutes, 86400 seconden and then start the next day.
|
|
|
|
|
marc1990 wrote: I'm working with borland C++ 6.0.
So, you posted your question on a Visual Studio site, on a Managed C++ message board...
Great,
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I'm sorry.
Could you recommend a other forum??
Great,
Marc
|
|
|
|
|
No problem.
I haven't used Borland in many years but I would start here[^].
I'm not sure what kind of script you're looking for but if you look at the list of message boards
at the top of this page you may find a more appropriate board to post the question on.
Good luck!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hi!
can someone give me a sample code on how to pass 2 different structs to a function with lpvoid as parameter and how to convert back to the structs from lpvoid.
the structs should be received by the lpvoid... how to combine the 2 different structs together? and how to split the lpvoid back to the 2 structs?
the structs are something like
typedef struct
{ int dataStructCount;
DWORD totalSize;
} strHeader;
typedef struct
{ int num;
lptstr str;
} dataStruct;
this will be used for writing and reading data from named pipe.. the header will be used to determine the count of dataStruct send/read.
thanks for any help!
newbie
|
|
|
|
|
Newbie,
First of all, you are in the wrong forum! This is the C++/CLI or Managed C++ forum. C++/CLI uses the .NET Framework and depends on Garbage Collection (GC) for memory management. It appears you are writing C or possibly C++ code. You should get better assistance int the Visual C++/MFC forum.
However, LPVOID is really a typedef of void* . Thus, LPVOID is a pointer to any type. Unfortunately, once a pointer of a type, in your case strHeader and dataStruct , is casted to a void pointer, LPVOID , its type information is lost. Thus, if you have a function that accepts void pointers, the compiler will not help you with type checking.
void Foo(LPVOID header, LPVOID data)
{
strHeader* theHeader = (strHeader*) header;
dataStruct* theData = (dataStruct*) data;
}
int main()
{
strHeader header;
dataStruct data;
Foo(&strHeader, &dataStruct);
return 0;
}
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
oooopppss! sorry! i did not notice the message board... i thought i was posting in vc++/mfc forum...
i have reposted the qxn there...
thanks for your reply!
however, for the foo function... i only have 1 LPVOID paramter...
thus the strHeader and dataStruct should be combined together and passed as 1 data to function Foo....
newbie
|
|
|
|
|
Hi
I'd like to be able to take a set of bitmaps and write them to an avi file without having to use vfw or anything platform specific since it has to be cross-platform
i don't need audio or anything else - just a sequence of images - any ideas?
|
|
|
|
|
|
hi
thanks for the reply but that article show's how to load an avi file as a resource - what i need to do is save a sequence of images as an avi file without using vfw.
|
|
|
|
|
If cross-platform is your goal, then using C++/CLI that depends on the .NET Framework would be a bad idea. You are in the wrong forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I'm trying to understand how I can create a DLL that contains a wrapper (managed code), to use a C++ (unmanaged) class using C# or VB.NET.
I found some articles (es http://www.codeproject.com/useritems/WrappingUsingManagedCpp.asp[^])that suggest this way:
(SimpleClass is my C++ class)
namespace Managed{<br />
public __gc class WrappClass<br />
{<br />
private:<br />
SimpleClass* pClass;<br />
public:<br />
WrappClass(){ pClass=new SimpleClass()}<br />
~WrappClass(){ delete pClass; }<br />
int Foo();<br />
};<br />
}<br />
It will be well compiled...but the linker tells that operators 'new' and 'delete' are unknown (error LNK2020)....
What is wrong??? I wrote only 20 code lines!!
Is there some settings in Visual Studio to solve this problem?
Have you got some link to a simple project like mine ... that is working?
Thanks
Cheers,
Russell
|
|
|
|
|
Looks like you are using VC++ 2005. If you want to use the old syntax, you need to specify /clr:oldsyntax in the compiler settings.
But I'd recommend that you use the new syntax instead.
Regards,
Nish
Fly on your way like an eagle
Fly as high as the sun
On your wings like an eagle
Fly and touch the sun
|
|
|
|
|
mmm...no, I'm using VS2003 (recently updated from internet with some patches).
i tryed to use /clr:oldsyntax....but it doesn't know this option (the option /clr it is just included into che command line).
I also tryed to use gcnew (instead new) but it is an unknown command.
it is driving me crazy
thanks
Cheers,
Russell
|
|
|
|