Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
F

Farah Mansor

@Farah Mansor
About
Posts
14
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Thread and ActiveX component
    F Farah Mansor

    Yupp. I already assign *pDlg to point to an instance of myDlg. FMansor

    C / C++ / MFC question help com

  • Thread and ActiveX component
    F Farah Mansor

    mmm.. it seem it doesn't work with the critical section. Still give me the same error. :( Don't know why thread still cannot call the activeX control methods? :(( :(( FM

    C / C++ / MFC question help com

  • Thread and ActiveX component
    F Farah Mansor

    Here I post some sample codes: // myDlg class (class A) CSocketSvr mySocket; // my socket variable // ActiveX event handler void myDlg::OnReceivedData(LPCTSTR ReceivedData) { ... // I start my thread - it will execute for the first time I receive any data if (TRUE) { pThread = (CWzdThread*)AfxBeginThread(RUNTIME_CLASS(CWzdThread), THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED); } ... } // my method void myDlg::Check() { if (mySocket.GetConnectedStatus()) <--- THIS IS WHERE IT GIVES ME THE RUNTIME ERROR { ... } } ///////////////////////////////////////// // CWzdThread class (class B) myDlg* pDlg; int CWzdThread::Run() { while(TRUE) { ... pDlg->Check(); } } /////////////////////////////////////////////// // CSocketSvr class (the activeX control class) // to get the connection status bool CSocketSvr::GetConnectedStatus() { .... return result; } I think this will give you enough information about what I am trying to do here. mmm I still don't get it where should I add the Lock function. :confused: Can you please explain more on that. :) Thank you so much for your help. :rose: FM

    C / C++ / MFC question help com

  • Thread and ActiveX component
    F Farah Mansor

    I have 3 classes: class A - dialog class class B - thread class class C - ActiveX class (included in dialog) (the activeX component is a socket component and I create one variable for it in dialog class) The scenario is like this: The dialog will be initialized. The application will winsock other application. After it receive a data from socket component, it will initiate the thread. The thread then will call one method in dialog class which is using socket component. What the method (inside dialog class) should do here is, it will check the connection status. But it failed (it gives me runtime error - access violation error) The question is: 1) How can I call method in class C(activeX component) straight from class B?? 2) If cannot call directly from class B, where can I call the method? I try to call from class A but it failed. so can anybody help me to resolve on this. I want to use the thread for checking the status connection. Thanks in advance.:) FM

    C / C++ / MFC question help com

  • SSPI context
    F Farah Mansor

    :( How to replace the timer, and with what?? And can I know what do you mean by using database in a tight loop?? This application cannot be stopped or closed, unless there is a network connection error. Could be the network error?? X| Thank you so much for your help.:rose: FM

    C / C++ / MFC database help question

  • SSPI context
    F Farah Mansor

    Yes. But it will continue to loop after it finishing the task (open, write and close). This is done by using KillTimer and SetTimer back. :| Thanks in advance. p/s: My supervisor said it is because my program keep generating a user in the database until it exceeds the limit and gives me that dialog box saying "cannot generate SSPI context". Could this be the problem?? But I already check my code and I close every database that I open. X| +:confused: = :(( FM

    C / C++ / MFC database help question

  • SSPI context
    F Farah Mansor

    Hi all, :) I just create one program using timer and it connect to database to process something. I try to leave my program running one day, but what I get next morning is it prompt out a dialog box say "Cannot generate SSPI context". I don't know what it is.:confused: + X| +:(( Can anybody help me to resolve on this?? I really appriate it. Thank you. :rose: FM

    C / C++ / MFC database help question

  • memory usage
    F Farah Mansor

    What is BoundsChecker?? I seen it in other msg too but still don't know what is BoundsChecker. Can you please explain what it is.:) Thanks for your help. :rose: FM

    C / C++ / MFC help question database performance tutorial

  • memory usage
    F Farah Mansor

    Hi all, My program is using thread and keep checking and inserting into database. I try to let my program running overnight and when tomorrow morning I found out that it gives me a runtime error. The memory usage increased slowly and this given me the problem (out of memory). Can I know how can I resolve it?? For example, make the memory usage and cpu usage stable. Please help me.:confused: X| Thanks in advance. :(( FM

    C / C++ / MFC help question database performance tutorial

  • DoModal method
    F Farah Mansor

    This is CSecondDlg::OnInitDialog() code: BOOL CSecondDlg::OnInitDialog() { CDialog::OnInitDialog(); ... // TODO: Add extra initialization here // Create a StatusBar CRect rect; if (!m_wndStatusBar.Create(WS_CHILD|WS_VISIBLE, rect, this, IDC_STATUSBAR_STATIC)) { TRACE0("Failed to create status bar\n"); return -1; } // give first status bar pane a border int strPartDim[3]= {100, 130, -1}; m_wndStatusBar.SetParts(3, strPartDim); DisplayTime(); // to display time in status bar // 1st Thread CWzdThread* kpThread = (CWzdThread*)AfxBeginThread(RUNTIME_CLASS(CWzdThread), THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED); kpThread->SetOwner(this); if (!kpThread) { ASSERT(FALSE); return FALSE; } pThread = kpThread; pThread->ResumeThread(); // 2nd Thread CAnotherThread* kpThread1 = (CAnotherThread*)AfxBeginThread(RUNTIME_CLASS(CAnotherThread), THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED); kpThread1->SetOwner(this); if (!kpThread1) { ASSERT(FALSE); return FALSE; } pThread1 = kpThread1; pThread1->ResumeThread(); } m_bInformCSDA = FALSE; SetTimer(ID_COUNT_TIMER, 50, NULL); return TRUE; // return TRUE unless you set the focus to a control } My second dialog also using ActiveX control (for Winsock and create registry). Do these controls give me the problem?? Thanks in advance. FM

    C / C++ / MFC c++ help question

  • DoModal method
    F Farah Mansor

    Hi all, Can somebody help me on this. I create one dialog let say First dialog. On my First dialog I will validate the OnOK button and if it true open Second dialog. But before I open it, I should dispose the First dialog. This program work ok on my pc(which got visual c++). However when I install in a new pc, it doesn't open the Second dialog. The DoModal method return -1 in a new pc (I check this using text file). The codes are like these: in MyApp class: MyClass::InitInstance() { CFirstDlg firstDlg; m_pMainWnd = &firstDlg; int nResponse = firstDlg.DoModal(); } in CFirstDlg class: CFirstDlg::OnOK() { if (validate) { CDialog::EndDialog(TRUE); CSecondDlg secondDlg; int nResponse = secondDlg.DoModal(); // print nResponse to text file if (nResponse < 0) AfxMessageBox("cannot open second dialog"); else AfxMessageBox("Second dialog opened"); } else { ... } } The problem is how can I make sure that the DoModal method will give me a positive value so it can display the second dialog?? My second dialog is using thread and the first dialog don't. Is the thread give me the problem?? What make me feel weird is it works fine in my pc so I cannot detect what's wrong with the code. :confused: Anybody can help me?? Thanks in advance. FM

    C / C++ / MFC c++ help question

  • Installation
    F Farah Mansor

    Hi all, I've got one question here about the installshield. How do I know what dll should I insert into my installshield program?? Now I try to create one installshield for my application. I copied all the dlls needed but I'm not really sure whether they are correct or not. When I try to install the application it works fine but it automatically dispose the dialog box. This is happen when I install in a new pc ( with no visual c++). However, when I tested on my pc ( which got visual c++), the application works fine. My application is a dialog based application which using thread. Thanks in advance. :) Regards, Farah FMansor

    C / C++ / MFC question c++

  • Dynamic controls
    F Farah Mansor

    How can I create dynamic controls? eg: I want to create an edit box or radio button based on what user input. If user want one edit box so I have to create one edit box. If two edit box, the application should have two edit boxes. Anyone know how to do it? Thanks in advance.:) FMansor

    C / C++ / MFC question tutorial

  • Panel in C++??
    F Farah Mansor

    Hi all, Do C++ got Panel like in Java ?? Let say if I want to create something like panel, how should I do it? Can I use group box to group everything together? I tried but it doesn't show like what panel can do. eg: can't hide every controls in that group. Thanks. :) FMansor

    C / C++ / MFC c++ java question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups