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
A

Arman S

@Arman S
About
Posts
248
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Select top 2 not working on Maximum Record using SQL
    A Arman S

    select T.ElectionDtlID, T.PartyShortNameEng, T.ConstituencyName, T.VotesObtained
    FROM (select * from tblElectionsDetail where ConstituencyName='NA 108' and electionyear='2013' order by VotesObtained desc limit 2) T order by T.VotesObtained asc;

    -- Arman

    Database database help question

  • Comparing values in the table with the value the user keyed in
    A Arman S

    Agreed - generally speaking. But not quite, for this concrete situation. If it were so, why wouldn't you go ahead and explain the whole theory behind secure Web development to the OP? Common sense tells me, that you (and I) didn't do it as: * We are not sure if it will solve a bit of OP's problem * We are not sure if OP is even doing e.g. Web * We are not sure if the proposed solution above (by myself) even targets the right problem (because of poor explanation of the problem) My belief is that for beginners (assuming OP is) what matters most is the tangible result, something they can see and the feeling that something is working.

    -- Arman

    Java question java database help tutorial

  • Comparing values in the table with the value the user keyed in
    A Arman S

    lol, the OP should first realize the existence of such a construct and then understand it's disadvantages. Thanks!

    -- Arman

    Java question java database help tutorial

  • Comparing values in the table with the value the user keyed in
    A Arman S

    I'm not sure what you mean "... check/compare values in the table and with the values the user keyed into the textboxes." But I guess you need to get the value from the textbox and write your sql like so:

    String myKey = myTextBox.getText(); // something like this to get the value from the textbox

    Statement stmt = con.createStatement();
    // change the PERSONNAME with an appropriate column from your table INCIDENTDATA.
    ResultSet rs = stmt.executeQuery("SELECT INCIDENTID FROM INCIDENTDATA WHERE PERSONNAME = '" + myKey + "'");

    // And the rest is the same...

    -- Arman

    Java question java database help tutorial

  • JPEG Image to an array format
    A Arman S

    It depends what you want to achieve. Also depends how your jpeg is represented to you, i.e. do you have a file handle, etc etc. So you if you post some more details, it'll be easy for us to help.

    -- Arman

    C / C++ / MFC data-structures help tutorial

  • Comparing values in the table with the value the user keyed in
    A Arman S

    Post some code snippets, otherwise it's very hard for us to guess what's working what's not.

    -- Arman

    Java question java database help tutorial

  • Problem with WaitForSingleObject
    A Arman S

    OK, here is your problem: you are passing the returned value (CWinThread pointer) from AfxBeginThread to WaitForSingleObject, which is not correct. Instead, you should pass the HANDLE defined inside those m_pcThread1 and m_pcThread2. Like so: WaitForSingleObject(m_pcThread1->m_hThread,INFINITE); WaitForSingleObject(m_pcThread2->m_hThread,INFINITE);

    -- Arman

    C / C++ / MFC help question

  • Thread
    A Arman S

    As far as I understand, you want to pass a function pointer to a thread procedure. In a simplified way it could be done like so: void MyFuncToPass(int) { //.. } UINT MyThread(PVOID param) { typedef void (*F)(int); F func = (F)param; func(10); // Call my func passed return 0; } void TheCaller() { // run the thread and pass the function to it. AfxBeginThread(MyThread, (void*)MyFuncToPass); }

    -- Arman

    C / C++ / MFC help tutorial question

  • Problem with Array of char*
    A Arman S

    You missed to tell us how your 'name' variable is declared/defined :). Except for it, other stuff seems OK to me (in the sense that they should not provoke a crash).

    -- Arman

    C / C++ / MFC help data-structures question

  • OnSize() function help
    A Arman S

    WM_GETMINMAXINFO BOOL IsIconic(HWND wnd)

    -- Arman

    C / C++ / MFC help

  • A Question about Buttons
    A Arman S

    Some quick hints; * try to set background color (instead setting transparent) via CDC::SetBkColor. Here you need to create a HBRUSH object as a member variable in your CMainWindow class (i.g. in constructor; m_brush=::CreateSolidBrush(RGB(my color)) .) Then return that m_brush from OnCrlColor any time you set SetBkColor. * I'm pretty sure here at codeproject there could at least several good articles on WM_CTLCOLOR and/or OnCtlColor. I think you need make a search for those keys. Regards.

    -- Arman

    C / C++ / MFC help question

  • C program - modify bubble sort - need someone to check my code
    A Arman S

    Don't like to do exercise for others :-D Anyway, the following is the fastest possible bubble sort I know;

    // Assusme an array A of ints of size N.
    bool sorted = false; // THIS MAKES THE TRICK
    for (int i=1; i<N && !sorted; ++i)
    {
    sorted = true;
    for (int j=0; j<N-i; ++j)
    {
    int k = j + 1;
    if (A[j] > A[k]) {
    int t = A[j];
    A[j] = A[k];
    A[k] = t;
    sorted = false;
    }
    }
    }

    -- Arman

    C / C++ / MFC data-structures performance help question code-review

  • A Question about Buttons
    A Arman S

    I didn't mean a CButton derived class but the class inside which you create your buttons. I assumed it could be CDialog derived class (that is why the name CMyDlg) but actually it may be any CWnd derived class.

    -- Arman

    C / C++ / MFC help question

  • A Question about Buttons
    A Arman S

    I think you need to handle WM_CTLCOLOR message and set the buttons background transparent and/or set a specific color for it. Something like this:

    HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
    {
    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
    if (pWnd->GetDlgCtrlID() == IDC_MYBUTTON)
    {
    // Set the background mode for text to transparent
    pDC->SetBkMode(TRANSPARENT);
    }
    return hbr;
    }

    -- Arman

    C / C++ / MFC help question

  • A Question about Buttons
    A Arman S

    Seems a regular way of crating buttons and I don't see any special code that would make the button to draw its background differently... Are you sure that is the text that makes the button draw its bg differently?

    -- Arman

    C / C++ / MFC help question

  • Alternative for CMap in MFC
    A Arman S

    So you need the interface of CMap and the implementation of std::map..? If so, then you need to declare your own CMyMap with an std::map member variable declared in it, and try to implement CMap similar functions in your CMyMap. However, you cannot simulate hash code related functions of CMap via a std::map.. Did I understand your problem correctly?

    -- Arman

    C / C++ / MFC c++

  • enabling keyboard shortcuts in my application
    A Arman S

    To handle key pressings in dialogs, one should override PreTranslateMessage. It's MSG argument has the necessary information about pressed keys.

    -- Arman

    C / C++ / MFC question

  • An struct declared within another struct.
    A Arman S

    std::map uses operator ==?? I think no. It uses std::less predicate which uses operator < by default. And for string pointers it's common to use them as keys because identical strings are stored in the same location and different strings (I mean const char* ) in different. But surely, I'd chose std::string as a more modern (and event more) alternative to those const char pointers!

    -- Arman

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

  • Alternative for CMap in MFC
    A Arman S

    ... in addition, perhaps the biggest difference is that CMap uses hashing for its keys, and std::map uses key comparisons to store them in some sorted order.

    -- Arman

    C / C++ / MFC c++

  • rand() is not random
    A Arman S

    Without some code, I cannot say much. But I've the feeling you're calling srand and rand pair each time generating another random number (and which is the seed for srand?). Generally, srand is called before first call to rand and that is it.

    -- Arman

    C / C++ / MFC help tutorial question lounge
  • Login

  • Don't have an account? Register

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