|
Hi David,
If you can give me some key code fragments for the tokenize, that would be a great help.
Thanks
|
|
|
|
|
strtok() (C)
AfxExtractSubString() (MFC)
CStringT::Tokenize() (MFC)
C++ does not have a formal string tokenizer, but it's very easy to create one using a vector to hold the tokens. You may also be able to do it via istringstream .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
after tokenizing, how to convert char to float ?
float ff;
ff = float(strtok(string, seps));
not working
|
|
|
|
|
mrby123 wrote: after tokenizing, how to convert char to float ?
Use atof() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I have tried to build a project which has written in vc++/MFC. The project last build with 7.10 version and I am trying to build it using VS.Net 2003 and VC++ compiler version 7.1.3088. When it reaches to the part "Linking" start throwing the following type of link errors,
error LNK2005: "private:_thiscall type_info::(classs type...
error LNK2005 _abort already defined in libcmtd.lib(dbgheap.obj)
etc
I am sure , no error is there with the program and it is compiling fine..I would really appreciate if anybody can show me the right way to resolve these type of errors.
Note: I have seen the existing project contains a file with ".odl" extension and I changed to ".idl" because I found while creating a new project it is creating ".idl".
Thanks In Advance.
Rahul
SoftwareDeveloper(.NET)
|
|
|
|
|
That looks very much like you're linking your program against two versions of the C runtime library somewhere. The 'already defined in libcmtd.lib' bit gives it away.
Can you check that all projects in the solution have the same runtime library selected in the C/C++->'Code Generation' property page?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi Stuart Dootson,
Thanks much for your response. I have checked the runtime library and its same for all the projects. ("multi-threaded debug"(/Mtd)). One difference I found is that, some projects having Basic runtime checks as default and some having "both".
When I tried to rebuild each project separately, only one project was showing link error ...All other projects got rebuilded file.
Please let me know if you have any other suggestion.
Thanks,
Siju Thomas.
SoftwareDeveloper(.NET)
|
|
|
|
|
Since I couldn't find a way to solve the linking error, I have tried to create a new project and replaced the automatically created files and added the files from the existing project..when I build that it was able to link with out any Issues..It didn't throw any linking error.
But, I have got another error which is given below.
while debugging
"error PROJ0019: A tool returned an error code from "Performing Registration"
While manually resistering the ocx
" DLLRegister failed, Return code was: 0*80040200"
Any idea to resolve this?
Thanks,
Rahul.
SoftwareDeveloper(.NET)
|
|
|
|
|
hi all!
Can any one tell me how can we create a satellite DLL to support german languagae....for an MFC aplication.
Reply ASAP....
Regardx!
|
|
|
|
|
Well, creating a DLL is quite simple, on the other hand, putting it into orbit is a rather complex task.
BTW: Do you know the powerful CodeProject's article search engine? [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In the properties of the DLL project, set the "No Entry Point" property in the advanced linker options to true.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hi,
I need to compile the vc++ 6.0 code project into vs2008 (c++). Please anyone provide me the guidnace or any link, that help me out to remove all the errors after conversation.
Pankaj Gupta
(Take it easy)
|
|
|
|
|
1- double-click on the DSP (or is it DSW) file.
2- accept to convert the project files.
3- save
4- build-all
5- look at the errors/warning
6- google the error number
7- fix them.
8- goto 4
anyway ... most errors are due to new method/functions prototypes in MFC, and some deprecated C functions.
This signature was proudly tested on animals.
|
|
|
|
|
Thanks.
Pankaj Gupta
(Take it easy)
|
|
|
|
|
else break;
end: Go back to VC++ 6.0.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Hi All,
How to split the CString in MFC?
My clode is:
CString str;
str = "READ rd659885676R8667U7788";
I need to split the CString with " "(space). That is i need "READ" in one variable and "rd659885676R8667U7788" in another variable.
Please help me.........
Regards,
Anitha
|
|
|
|
|
CString::Tokenize() ?
For urgent purposes, you can try TokenizeUrgnz().
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Welcome in the CP's Memorable Quotes [^], man!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thank you. Now, *that* is a honor.
It took me a while to make it to the list though.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
You can use AfxExtractSubString() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi Anitha,
You can use this code:
void
CSplit::Split(CString str, CString separator, CStringArray& array)
{
CString aux;
int pos;
pos = 0;
array.RemoveAll();
for (int i=0; i<str.getlength();> {
if (str[i]==separator)
{
aux = str.Mid(pos,(i-pos));
pos = i+1;
array.Add(aux);
}
}
aux = str.Mid(pos,str.GetLength()-pos);
array.Add(aux);
}
Regards,
Gustavo
|
|
|
|
|
Hello.
I can use CClientDC and its TextOut function in C~~View class.
It's quite simple like this:
void C~~View::OnLButtonDown(UINT nFlags, CPoint point)
{
CClientDC dc(this);
dc.TextOut(x, y, "..");
}
Yet when I use this function in my 'added' class, which is not derived class of CView,
an error occurs.
like this:
void CMyclass::memfunc()
{
CClientDC dc(this);
dc.TextOut(x, y, "..");
}
So I changed the code like this:
[C~~View.cpp]
void C~~View::OnLButtonDown(UINT nFlags, CPoint point)
{
CClientDC dc(this);
CMyclass myclass;
myclass.memfunc(dc);
}
[CMyclass.cpp]
void CMyclass::memfunc(CClientDC dc)
{
dc.TextOut(x, y, "..");
}
And errors still occur.
Of course, I linked the header file of my class to C~~View.cpp.
I want to display Text or Images on window with code in 'my class'.
Please give me advice or ideas. Thank you.
May the sky bring you a full measure of health and prosperity.
|
|
|
|
|
You should pass the device context by reference, i.e. change your function definition (remember to change the declaration too):
void CMyclass::memfunc(CClientDC & dc)
{
dc.TextOut(x, y, "..");
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thank you so much! You saved me!
May the sky bring you a full measure of health and prosperity.
|
|
|
|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|