Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / When i use wx object, i can't use the functions called from included file

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. When i use wx object, i can't use the functions called from included file
#2487
Posted by: 2003-08-20 20:25:13
I am do like this:

#include <mylib.h>
#include <wx/wx.h>

....
....

MyFrame(_T(testme()),....

...

in mylib.h , i do like this:

#include <string>

string testme();

string testme() {
return "abc";
}


it prompt me errors, if it is just developing dos application, and call the header file, mylib.h, it is running ok, but, if use wx, it's going down... :(

what can i do now?

thanks...
Message2. Re: When i use wx object, i can't use the functions called from included file
#2488
Posted by: guidance 2003-08-20 21:06:33
Why not use wxString instead?
Message3. Re: When i use wx object, i can't use the functions called from included file
#2489
Posted by: 2003-08-20 22:12:43
Hi,

you means, use wxString inside mylib.h?

thanks.
Message4. Re: When i use wx object, i can't use the functions called from included file
#2498
Posted by: guidance 2003-08-21 07:44:40
Yes. Can't?
Message5. Re: When i use wx object, i can't use the functions called from included file
#2499
Posted by: 2003-08-21 08:54:13
yup, can't..

i have try with this:

wxString testme() {
      return "hi, this is testing only";
};

finally, giving me this error message:

parse error before ')'

same error message when i use string testme() { .. }

if i replace string to char, it gonna ok.

Or.. got any solutions that, i can return whole string from functions?

Thank you.
Message6. Re: When i use wx object, i can't use the functions called from included file
#2500
Posted by: guidance 2003-08-21 10:57:12
Have you included necessary wxWindows headers before use any wx objects? Return a wxString works for me :)
Message7. Re: When i use wx object, i can't use the functions called from included file
#2501
Posted by: 2003-08-21 13:42:44
yes i do, but, i dont know why.

Meanwhile, i wonder is the file crashed.  Becuase, when i re-coding again, and compile, it gonna alright now.. -_-"

How do i call wxRegEX object inside?  becuase, i can't use regulation express now.. :(

Thanks...
Message8. Re: When i use wx object, i can't use the functions called from included file
#2502
Posted by: guidance 2003-08-21 13:52:16
"can't use" means compile error or runtime error?
Message9. Re: When i use wx object, i can't use the functions called from included file
#2503
Posted by: 2003-08-21 15:21:09
i think, is.. no such that function...
Message10. Re: When i use wx object, i can't use the functions called from included file
#2504
Posted by: guidance 2003-08-21 18:05:37
Link error? Most probably due to wx lib is not configured with regex enabled. Try these pre-compiled libwxmsw.a : http://g.yi.org/_scripts/file.php?f=2618&r=46
Message11. Re: When i use wx object, i can't use the functions called from included file
#2509
Posted by: 2003-08-21 22:25:05
it displayed me "ReplaceAll undeclared"

mytext=ReplaceAll("a","e");
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-10-5  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0