|
I have to read a file that has 2 integers in each line. I'm using Visual c++ .net and I read the file like this:
String *l = s->ReadLine();
How can I split the String to have 2 different Strings, each one with one integer?? I know there is a function for String that is called Split but I don´t know how to use it.
Thanks for your help
|
|
|
|
|
Hi,
U Can Use Split Function Like Below. Assume That your string contains 2 integers .seperated by "," or space or any other delimiter.
System::String* YourString = new String("1,2");
System::String* SplitString[]= __gc new String*[2];
SplitString[0]=",";
SplitString = YourString.Split(SplitString[0].ToCharArray(),2); here delimiter ","
by
baiju.km
|
|
|
|
|
I noticed that CodeProject:MaChat - a chat with a browser for LANs, which incidentally is one of the many wealths on this site, can only be compiled in 2002.VS.net. 2003 throws a datatype error. What specifically is different between these IDE versions which would cause this type error.
Just curious
|
|
|
|
|
I have created a new c++ Class Library Project, I've compiled it and dll (x)has been created, now I have a c++.net console app and want to reference x dll. I add the reference and on object browser I can see assembly, namespaces and classes, but when writing using namespace x, I can not reference the classes in the namespace from dll.
I am seeing in the object browser that what is a class in my class library is a public sealed struct (System.ValueType) in the assembly when I reference it.
What am I doing wrong...
|
|
|
|
|
InternetCrackUrl takes an URL_COMPONENTS structure as a parameter, and contained within that structure are various pointers to buffers and associated lengths. One of the options for retrieving information on an URL is to pass a length for a given string as 1, but have the pointer itself pointing to NULL. If one does this, InternetCrackUrl will allocate a buffer for the string in question. My question is, how does one free this memory?
Thanks in advance
|
|
|
|
|
I'm using VC++ 2005 Express Edition. When I try to use wizard for adding a class or a function an error causes so I have to add my classes and functions manually.
Do u have the same problem or not?
|
|
|
|
|
I use VS 2005 beta, and I have a similar problem.
No error occurs, but the wizard still won't work.
It just adds a new, empty file.
|
|
|
|
|
I promised a company I would program a small application (using win32/mfc/vc++) that would put their logo in the top, right corner of every document printed (no matter from which application). I thought this would be an easy task , but...
I've spent hours on the net and can't find any information even touching the subject of editing already queued print jobs
Please help me...
|
|
|
|
|
I have this strange problem: i am importing ExitWindowsEx function from the user32.dll file to shut down and restart computer. When i start my application from Visual Studio it works just fine but when i start it directly nothing happens. ( Note that Log Off feature works without any problems, and it uses the same function, only with a different parameter, of course. What is happening with my application ???
--Nikola--
modified 7-Dec-20 21:01pm.
|
|
|
|
|
sorry, bit of a newbie
noticed this code on page: http://www.codeproject.com/shell/SHDireSizeColumn.asp
Display content size for a folder in Explorer using shell extensions
but how do i enable this for my XP PC?
|
|
|
|
|
hi ,
i want the source code to the desktop sharing apllication in vc++.net
can anybody help me,
thanks,
|
|
|
|
|
Hi,
Is it possible to conditionally change the value of the "Browsable"
attribute at the top of the property constructor at runtime in VC++.net?
For example, I would like to conditionally change the following property
(PartNumber) to display in a property grid. I can control whether it
displays by inserting either Browsable(True) or Browsable(False), but I
would like to do this programmatically based on a condition.
[Browsable(True)]
__property String* get_PartNumber()
{
return _partNumber;
}
__property void set_PartNumber(String* value)
{
_partNumber = value;
}
thanks,
Pradeep
|
|
|
|
|
Is there a way to properly get the handle of an MDI child window thats been added. I am creating a new form then making it a child of my parent MDI form:
<br />
mFrmSubWindow->MdiParent = this;<br />
Then I'm trying to get the windows handle, I do this by calling a fuction which does:
<br />
(HWND)this->Handle.ToInt32()<br />
When I call this I get an exception with the error "Error creating window handle" perhaps I am going about this the wrong way or not doing it properly?
Thanks!
|
|
|
|
|
Hello,
I have Windows Forms application (VS .NET 2003) where I need to draw several lines directly on some Form. How can I prevent those lines to be erased by overlapped window? What type of private member in this Form class do I need to use to store picture and use it inside “OnPaint(PaintEventArgs* e)” method to redraw this Form properly?
Thanks a lot for help, regards,
Leon
|
|
|
|
|
Hello
I´m working with a Genetic Algorithm library (GALIB), written in C. I know for sure that it works perfectly in VC++6.
Still I've got a problem:
I've got an error from one of the constructors defined in the library, and my question is:
ISN'T IT POSSIBLE TO PARSE A PARAMETER OF A CONSTRUCTOR FROM A POINTER TO A VOID?
I wrote the following lines:
class GAParameter
{
public:
GAParameter(char *fn, int tp, void *v); // line 32
~GAParameter(void);
};
The error:
GAParameter.h(32): error C2629: 'GAParameter (' unexpected
GAParameter.h(32): error C2238: token unexpected before ';'
PS: when I don’t write “void *v” there is no error, but I need this pointer!, and I can't discover what causes the problem.
THANKS A LOT
|
|
|
|
|
I have some experience programming in C# .NET but am new to C++. Could somebody please tell me what the difference between "->" and "." are in C++, which is to say:
when is it appropriate to use
someclass.whatever
and when is it correct to use
someclass->whatever.
Thanks!
|
|
|
|
|
"ptrsomeclass->whatever" is shorthand for "(*ptrsomeclass).whatever"
you must have a pointer to someclass to use ->
you must have a direct instance of someclass to use .
for example:
someclass someobject;
someclass* ptrobject = &someobject; //&=addressof
someobject.whatever;
(*ptrobject).whatever; //* dereferences address
ptrobject->whatever; // same as line above
Sincerely,
-Ron
|
|
|
|
|
I opened file with modes
CFile mode :: Create, Write, NoTruncate.
made SeekToEnd
But it overwrits file.
How to just add information to file ?
Thanks
|
|
|
|
|
How to get "file size ON DISK" ?
but not logical size, as
DIR comand says,
but full size -with taken claster size?
Are there such API ?
thanks.
|
|
|
|
|
HANDLE hFile = CreateFile(...);
DWORD dwSize = GetFileSize(hFile, NULL);
.
.
.
CloseHandle(hFile);
|
|
|
|
|
I am using
Interop::SHDocVw::InternetExplorer *ie = new Interop::SHDocVw::InternetExplorerClass();
Object *o=NULL;
ie->Navigate("https://www.someplace.com",&o,&o,&o,&o);
mshtml::HTMLDocument *myDoc=new mshtml::HTMLDocumentClass();
myDoc = dynamic_cast<mshtml::htmldocument *="">(ie->Document);
to open IE and navigate to a web page, this page contains a frame
which in turn contains a frame
which contains a form
that contains a table with a field
and a button
SearchFrom the main page I want to simulate entering text in the editbox and clicking the button
I assume i am going to have to use one or more HTMLFrameElement, HTMLTable, and HTMLFormElement but I have not been able to get these working correctly
Thank You
|
|
|
|
|
I can get the first frame usnig
mshtml::HTMLFrameElement *frame = dynamic_cast<mshtml::htmlframeelement*>(myDoc->all->item(S"frameIWant",0));
but I am unable to get the frame within this frame (which in turn has a frame, which has a frame, which has a table that contains the edibox and button I want)
|
|
|
|
|
Hi,
Please help me!
How use ProgressCtrl to present runing program in another main form?
Thanks
|
|
|
|
|
Greetings All -
Looks like i got myself into trouble when I tried to remove an empty event placed into visual studio 2003, VC++, .net project.
I tried removing an event for a button, but couldn't figure out how to do it. So I manually deleted the generated event, and removed the code in InitializeComponent() for the event i didn't want - i then noticed the comment about do not edit stuff in this method.
Well as a result the editor is all screwed up.
For example - i compile the program, and it reports an error on line 200 - when the real line is actually 60 lines below. I also drop a button on the form and double click to generate a click event, and the editor places me about 50 lines above the generated event.
Is there a way to re-sync the editor? Or do i just have to remake my form in a new project?
Any help would be much appreciated.
Thanks,
CurtC.
|
|
|
|
|
Like because it compiles like c++ is it safe from programs like reflector? or is no .net language safe?
|
|
|
|