My freakin' bad :zzz: :mad: :(( :laugh: When fetching the text from the TextBox, I was using this.PriceEdit.ToString()... Ah ah ah !!! Wrong... This got me some undesired text in the string. I found that I need to use the TextBox.Text to access the text entered !!! Luc.
Luc Bergeron
Posts
-
Single.Parse(string) problem... -
Single.Parse(string) problem...Hello everyone, i'm quite new to this c# world so please bear with me :) So I have this form and in it I have an editbox in which I must enter a number, in the following form : 119.43. Now, I need this string to be converted to float. Here's how I do it : float p = System.Single.Parse(prixS); BUT, I always get a string not properly formatted exception. I tried entering the price with a comma, no can do. Than I tried this : prixF = (float)System.Single.Parse(prix, System.Globalization.NumberStyles.AllowDecimalPoint| System.Globalization.NumberStyles.AllowTrailingWhite| System.Globalization.NumberStyles.AllowLeadingWhite); But again same error. Can someone please help me on this. Thanks for any help. Luc.
-
Man arrested for 'peace' T-shirt'wearing of apparel... likely to provoke disturbances... is prohibited' And a t-shirt that says "Give peace a chance" is likely to provoke disturbances ??? :confused: :wtf:
-
Embedded CPropertySheet : HOWTO change CPropertyPage programatically ???Cool. Your suggestion work fine !!! :-D
-
Embedded CPropertySheet : HOWTO change CPropertyPage programatically ???Hello to all, I have an embedded CPropertySheet inside a dialog and this sheet contains 4 pages. The user can't access the second page unless he has entered and saved a record inside the first one. So in the SecondPage::OnSetActive() I query some data members and if nothing has been entered I call the parent PropertySheet and ask it to SetActive the first page. UI wise the first page is selected but the controls displayed are still those of the second page. What call(s) do I have to make in order to display what the first page has to offer in terms of controls ???? Thanks in advance for any help ! Luc :confused:
-
Problem with auto_ptr !!!Here is how FN_REGISTRY is defined...
typedef std::auto_ptr (*BASE_CREATE_FN)(const std::string&,
const std::string&,
const std::string&);// FN_REGISTRY is the registry of all the BASE_CREATE_FN
// pointers registered. Functions are registered using the
// regCreateFn member function (see below).
typedef std::map FN_REGISTRY;
FN_REGISTRY registry;And I use STLPort !!! P.S. How come, after using the pre tags, that my "<" and ">" gets deleted !?!?!?
-
Problem with auto_ptr !!!Hello to all. I've checked this following article (http://www.cuj.com/experts/1906/hyslop.htm?topic=experts) at CUJ web site and decided to use it in my own application. So here we go. I have managed to implement the factory inside a windows DLL. But i'm having weird problems with it. Mainly the genericFactory::create method. This is how i've implemented it (with the modification that I use a pointer to a function with three std::string parameters) : template std::auto_ptr genericFactory::create(const classIDKey &className, const std::string& p1, const std::string& p2, const std::string& p3) const { std::auto_ptr ret(0); FN_REGISTRY::const_iterator regEntry=registry.find(className); if (regEntry != registry.end()) { ret = regEntry->second(p1, p2, p3); } return ret; } And in my client code this is how I call it : std::auto_ptr tbl(0); tbl = genericFactory::instance().create("HistoricalDataTbl", host, user, pwd); ----------------------------------------------------------------------------------------------- When I trace inside the create method, the "ret" variable is fine and points to a valid MySQLTable object. BUT, when the function returns to the client code... I get an unhandled exception error. This error is generated inside the auto_ptr<>::reset() method. To be more precise, the "tbl" auto_ptr in the client code is supposed to be initialized with a NULL pointer but when getting back from genericFactory::create method the "tbl" pointer points to an invalid MySQLTable object. The quilty code inside auto_ptr : void reset(_Tp* __px=0) { _Tp* __pt = this->get(); if (__px != __pt) delete __pt; //offending line... this->__set(__px); } So i'm currently puzzled has to why the "tbl" variable points to a bad MySQLTable object!?!?!?! Any help would be greatly appreciated :-D Luc.
-
MUST See - LMAONot to brag(not sure if it's the correct word) about, but it took me less than 1 minute :)
-
World Mouse Clicking ChampionshipCool ! I got 47 :)
-
What size monitors do you guys use?Oh my god... Poor you... I have a 19 inch monitor with a res of 1280x1024 :) I can't and hope to never have to go back to something smaller than 17 inch !!!
-
Question for you cross platform programmersMight want to give GIMP a try !?!?! www.gimp.org Runs on Windows and Linux !
-
Hambut Loamsdown of Deephallow Lives!Oh boy mine is : Polo Gamgee-Took of Bywater !?!?!
-
Need your opinion for job change!!!You said it yourself... >It pretty much comes down to money unfortunately, which I think sucks because it shouldn't be my main concern. Take the pros and list them on paper... Take the cons and put them besides the pros... What weights more !?!?! You should never stay in a place only for money... Money isn't going to help yuo feel happy... Your friends, family, nature will !!! Luc.
-
UI Thread dummy window !?!?!?Nope doesn't work. My CConnection::PreTranslateMessage never gets called !?!?!
-
UI Thread dummy window !?!?!?Hi to all !!! I'm currently trying to code a Winsock server application. I'm using the main process thread to listen to incoming connection. When a connection is detected (i'm using WSAAsyncSelect) i spawn a new UI thread that will process that connection. I do not want a window to appear but i'm creating a dummy window because I need the message map... But the problem i'm having right now is that the messages for the WSAAsyncSelect goes to the dummy window and not to the UI thread message map... Here is how I create the dummy window... //------------------------------------------------- bool CConnection::InitDummyWnd(void) { m_pDummyDlg = new CDummyDlg; if (!m_pDummyDlg->Create(IDD_DUMMY, NULL)) return false; m_pMainWnd = (CWnd *)m_pDummyDlg; m_pMainWnd->SubclassWindow(m_pDummyDlg->GetSafeHwnd()); m_pMainWnd->ShowWindow(SW_SHOW); return true; } bool CConnection::PrepareWSAAsync(void) { if (WSAAsyncSelect(m_sock.getSocket(), m_pMainWnd->GetSafeHwnd(), WSA_THREADSOCKETEVENT, FD_READ | FD_WRITE | FD_CLOSE) == SOCKET_ERROR) { WORD err = WSAGetLastError(); return false; } return true; } //------------------------------------------------------------ How can I make sure that the thread message map gets all the winsock message instead of the dummy window message map ??? Thanks for any advice ! Luc B.
-
Interesting articleNope i'm canadian :) Or shall I say "Québecois" :confused: Luc.
-
Interesting articleInteresting article indeed !!! And a true one at that. Until the *&?%$ US gov. realise that they are responsible for what has happen to them in regard to their STUPID and hypocrite foreign attitude then the muslim world will never be free !!! People should learn the TRUE history of the american implication in other countries. Might I suggest a good web site : http://members.aol.com/bblum6/American\_holocaust.htm Luc. P.S. Flame me if you will, I don't mind :)
-
Ref: Nimda - virus for linuxIf your running a telnet daemon then your looking for trouble... Plain text passwords... Not very security conscious... Try running SSH instead ! Long live encryption !!! :)
-
Code Red WormYep there is a way to recover... And with what !?!?!?! A LINUX boot disk ;P http://home.eunet.no/~pnordahl/ntpasswd/
-
Could someone explain the following !!!Hi there, i'm curious about how does static_downcast and dynamic_downcast works ??? Thanks for any answer ! Have a nice day ! :)