Quantcast
Channel: CodeGuru Forums - C++ and WinAPI
Viewing all 583 articles
Browse latest View live

MultiThread Race Condition

$
0
0
MultiThread Race Condition

I am creating an application that is multithreaded and all the threads are accessing the same shared memory. The data coming into the memory should be processed in sequential order. Like if 1,2,3,4,5 comes in the memory then it should be processed in same order.

I have used critical section around my memory, but I still get into a race condition where data is not grabbed by the thread in sequential order.

Am I missing anything else to prevent threads from race condition?

Thanks.
ACpp

Abstract Class

$
0
0
Abstract Class


I have read a lot about abstract class, but still have questions, as I have not really used in my c++ code practically.

What is the use of abstract class ? Any sample I can take a look at ?

Thanks.

ListView Subclassing, WndProc, CDDS_ITEMPREPAINT

$
0
0
I'm trying to subclass NM_CUSTOMDRAW to handle CDDS_ITEMPREPAINT messages in WndProc(not in a dialogbox) and it keeps crashing.

Code:

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
...
 case WM_NOTIFY:
        switch(LOWORD(wParam))
        {
        case ID_LISTVIEW:
            LPNMLISTVIEW pnm = (LPNMLISTVIEW)lParam;
            if(pnm->hdr.code == NM_CUSTOMDRAW)
            {
              OldList = (WNDPROC) SetWindowLong(hWin_1, GWL_WNDPROC,
                              (LONG)ProcessCustomDraw);
         
            }
        }
        return 0;
...

My dilemma in the Callback function is that I should probably return CDRF_NOTIFYITEMDRAW and
CallWindowProc (OldList, hwnd, msg, wParam, lParam) ; also, so I dont know how to go about it.
I guess that's why it crashes.

Code:

LRESULT CALLBACK ProcessCustomDraw(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;

    switch(lplvcd->nmcd.dwDrawStage)
    {
    case CDDS_PREPAINT:  //Before the paint cycle begins
        /* Need to process this case and set
          pResult to CDRF_NOTIFYITEMDRAW,
          otherwise parent will never receive
          CDDS_ITEMPREPAINT notification. (GGH)*/
        return CDRF_NOTIFYITEMDRAW;
   
    case CDDS_ITEMPREPAINT: //Before item is drawn
    {
        int row = lplvcd->nmcd.dwItemSpec;
        if(row%2 == 0)
        {
            lplvcd->clrText  = RGB(255,200,255);
            lplvcd->clrTextBk = RGB(24,226,23);
        }
        return CDRF_DODEFAULT;
   
    }
    }

    return CallWindowProc (OldList, hwnd, msg, wParam, lParam) ;
}

Unable to get correct total number of pages while printing multiple copies

$
0
0
I am using windows print spooler notification functions, as FindFirstPrinterChangeNotification, FindNextPrinterChangeNotification to get JOB_NOTIFY_FIELD_TOTAL_PAGES, JOB_NOTIFY_FIELD_PAGES_PRINTED values. Normally it is getting the total pages printed. But when I am printing multiple copies (>1) of the selected page, it is not giving total number of pages printed but number of pages of the document being given for the print.

Kindly help me... please!!!!!!!!!!

With thanks & regards
Mukul Kumar

Jet OLEDB:Engine on Windows7 (64bit) - Compact Access Database problem

$
0
0
Hey ho!

I'm using ADO in my WINAPI project with Microsoft.ACE.OLEDB.12 (msado26.tlb) with no problem, but now I need to be able to compact the database from my application and i've learnt that to do so i need to add msjro.dll to my project to execute the following code:

Code:

void db_compact()
{
        try
{
  IJetEnginePtr jet(__uuidof(JetEngine));
  jet->CompactDatabase( "Provider=Microsoft.Jet.OLEDB.12.0;Data Source=d:\\xxx.accdb;Jet OLEDB:Database Password=test",
"Provider=Microsoft.Jet.OLEDB.12.0;Data Source=d:\\xxx.accdb;"
"Jet OLEDB:Engine Type=5;Jet OLEDB:Database Password=test");
}
catch(_com_error e)
{     
  errorhandler(e); 
}
       
}

IJetEnginePtr and JetEngine are properly recognized as classes in my Visual Studio but the problems is that when i try to import the JET dll itself by:
Code:

#import "C:\Program Files (x86)\Common Files\System\ado\msjro.dll" no_namespace
my compiler gives the following errors:
Quote:

2 <path>\msjro.tlh IntelliSense: identifier "_Recordset_DeprecatedPtr" is undefined 196
3 <path>\msjro.tlh IntelliSense: identifier "_Recordset_DeprecatedPtr" is undefined 224
4 <path>\msjro.tlh error C2146: syntax error : missing ';' before identifier 'ConflictTables' 196
5 <path>\msjro.tlh error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 196
6 <path>\msjro.tlh error C2146: syntax error : missing ';' before identifier 'GetConflictTables' 224
7 <path>\msjro.tlh error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 224
8 <path>\msjro.tlh warning C4183: 'GetConflictTables': missing return type; assumed to be a member function returning 'int' 224
1 <path>\msjro.tli IntelliSense: identifier "_Recordset_DeprecatedPtr" is undefined 111
9 <path>\msjro.tli error C2143: syntax error : missing ';' before 'IReplica::GetConflictTables' 111
10 <path>\msjro.tli error C2433: '_RecordsetPtr' : 'inline' not permitted on data declarations 111
11 <path>\msjro.tli error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 111
12 <path>\msjro.tli error C2064: term does not evaluate to a function taking 2 arguments 115
I cannot find any threat that gives some resolution to this problem which (from what i've read) apparently appears on WIN7 64 bit only (my OS!) although the application i compile is a WIN32.

Has anyone heard about any solution for this? From what i've read on other forums the JET does not go together with 64 Win7 but somehowe I have it installed. Only my compilator doesn't understand those certain parts of msjro.tlh and .tli... while importing that msjro.dll. I am a bit lost... :-0

will be grateful for any hint!

cheers
b.

Rebar not visible

$
0
0
I am making a paint program and I created a toolbar with my own images that works fine but I tried adding a rebar to it everything compiles fine but only the toolbar shows up not the rebar.

Code:

#define NUMBUTTONS 3

HWND CreateToolBar(HWND hWndParent)
{
       
        TBBUTTON buttons[NUMBUTTONS];

        HIMAGELIST himlToolBar = ImageList_LoadImage(
                m_hInst,
                MAKEINTRESOURCE(IDB_BITMAP1),
                16,
                1,
                RGB(255, 0, 255),
                IMAGE_BITMAP,
                LR_CREATEDIBSECTION);

       
        hWndToolBar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL,WS_CHILD | WS_VISIBLE |TBSTYLE_FLAT  , 0, 0, 1, 1, hWndParent, NULL, m_hInst, NULL);

        SendMessage(hWndToolBar, TB_SETIMAGELIST, 0, (LPARAM)himlToolBar);

        for(int i = 0; i < NUMBUTTONS; ++i)
        {
                buttons[i].iBitmap = i;
                buttons[i].fsState = TBSTATE_ENABLED;
                buttons[i].fsStyle = TBSTYLE_BUTTON;
                buttons[i].dwData = 0L;
                buttons[i].iString = (INT_PTR)L"New";
                buttons[i].idCommand = 0;
        }

        SendMessage(hWndToolBar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);

        SendMessage(hWndToolBar, TB_ADDBUTTONS, (WPARAM)NUMBUTTONS, (LPARAM)&buttons);

        SendMessage(hWndToolBar, TB_AUTOSIZE, 0, 0);

        return hWndToolBar;
}


Code:

HWND CreateRebar(HWND hWndOwner, HWND hWndToolbar)
{
        if(hWndToolbar == NULL)
        {
                return NULL;
        }

        INITCOMMONCONTROLSEX icex;
        icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
        icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES;
        InitCommonControlsEx(&icex);

        hWndRebar = CreateWindowEx(WS_EX_TOOLWINDOW,
                REBARCLASSNAME,
                NULL,
                WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
                WS_CLIPCHILDREN | RBS_VARHEIGHT |
                CCS_NODIVIDER | RBS_BANDBORDERS,
                0, 0, 0, 0,
                hWndOwner,
                NULL,
                m_hInst,
                NULL);

        if(!hWndRebar)
        {
                return NULL;
        }

        REBARBANDINFO rbBand = { sizeof(REBARBANDINFO) };
        rbBand.fMask =
                RBBIM_STYLE
                | RBBIM_TEXT
                | RBBIM_CHILD
                | RBBIM_CHILDSIZE
                | RBBIM_SIZE;
        rbBand.fStyle = RBBS_CHILDEDGE | RBBS_GRIPPERALWAYS;

        DWORD dwBtnSize = (DWORD)SendMessage(hWndToolbar, TB_GETBUTTONSIZE, 0, 0);

        rbBand.lpText = TEXT("");
        rbBand.hwndChild = hWndToolbar;
        rbBand.cyChild = LOWORD(dwBtnSize);
        rbBand.cxMinChild = NUMBUTTONS * HIWORD(dwBtnSize);
        rbBand.cyMinChild = LOWORD(dwBtnSize);

        rbBand.cx = 0;

        SendMessage(hWndRebar, RB_INSE*****D, (WPARAM)-1, (LPARAM)&rbBand);

        return (hWndRebar);

}


Code:

HRESULT InitializeWindow(HINSTANCE hInstance)
{

    HRESULT hr = S_OK;
        m_hInst = hInstance;
    // Create WIC factory
    hr = CoCreateInstance(
        CLSID_WICImagingFactory,
        NULL,
        CLSCTX_INPROC_SERVER,
        IID_PPV_ARGS(&m_pIWICFactory)
        );

    // Register window class
    WNDCLASS wcex;
    if (SUCCEEDED(hr))
    {
       
        wcex.style        = CS_HREDRAW | CS_VREDRAW;
                wcex.lpfnWndProc  = (WNDPROC)WndProc;
        wcex.cbClsExtra    = 0;
        wcex.cbWndExtra    = sizeof(LONG_PTR);
        wcex.hInstance    = hInstance;
                wcex.hIcon        = NULL;
        wcex.hCursor      = LoadCursor(NULL, IDC_ARROW);
                wcex.hbrBackground = (HBRUSH)::GetStockObject(WHITE_BRUSH);
                wcex.lpszMenuName  = 0;
        wcex.lpszClassName = L"WICViewerGDI";
     


     

        hr = RegisterClass(&wcex) ? S_OK : E_FAIL;
    }

    if (SUCCEEDED(hr))
    {

               
        // Create window
        ghMainWnd = CreateWindow(
            L"WICViewerGDI",
            L"PaintProgram",
            WS_OVERLAPPEDWINDOW | WS_VISIBLE,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            1920,
            1080,
            NULL,
                        NULL,
            hInstance,
            0
            );

                hr = ghMainWnd ? S_OK : E_FAIL;

                ShowWindow(ghMainWnd, SW_SHOW);
                UpdateWindow(ghMainWnd);

               
    }

        CreateRebar(ghMainWnd, hWndToolBar);
        CreateToolBar(ghMainWnd);
       
    return hr;
}


I cant seem to figure it out any help is appreciated.

Custom Command id's for WM_COMMAND

$
0
0
I want to know if it is possible to define a custom command to be sent to WM_COMMAND in the window procedure. For instance I made a toolbar and buttons are created with TBBUTTONS each one has a id command variable that can have STD_NEWFILE and things like that assigned to it.

Can I define my own command id like similar to STD_NEWFILE to be sent to WM_COMMAND whenever I select a button.

Smart Pointers / RAII / with Windows API like SendMessage

$
0
0
I'm writing code that requires me to pass a Buffer to Windows via SendMessage. I've been trying to ensure my app is RAII-compliant for good practice.

In the current example I'm trying to write a function that returns the Text of an Edit control as a std::wstring. I can't seem to get a smart pointer (unique_ptr?) to be used.

I've managed to make an ugly solution using try-catch(...), but it feels overkill and "wrong".

1. How would I go about doing this correctly?
2. Also, is there a way I can access std::wstring more directly, and modify it's buffer size, then parse it through the lParam?

My example with the try-catch(...):
Code:

std::wstring Text()
{
        int Length = SendMessage(m_hWnd, WM_GETTEXTLENGTH, NULL, NULL);

        if (Length <= 0)
                return L"";

        wchar_t *Buffer = NULL;
        std::wstring _Text;

        try
        {
                Buffer = new wchar_t[Length + 1];
                SendMessage(m_hWnd, WM_GETTEXT, Length + 1, (LPARAM)Buffer);
                _Text = Buffer;
        }
        catch (...)
        {
                if (Buffer)
                {
                        delete [] Buffer;
                        Buffer = NULL;
                }
        }

        if (Buffer)
                delete [] Buffer;

        return _Text;
};

Thanks.

I must restore the previous bitmap into the device context

$
0
0
Hi,
First, thanks for reading this stuf.
Some days ago I have written a windows ce program where I used double buffering. The problem was that I use a compatible bitmap to produce no flicking.
My program worked fine but if I leaved it a long time my pda finished without any memory. My program did not waste the memory, it was the system.
I had a headache until I saw an example that restored inside the compatible dc the previous bitmap, with SelecObject.
I had never done so with windows api and my programs have worked (or they seemed to work) fine. But at least with windows ce it is needed to work right.
And my question is: Is it needed in win32 api? Why?
Thanks in advance.

C++ dialog listbox display outside the dialogbox

$
0
0
I'm trying to duplicate a listbox I saw in another application. It
looks like this:

Name:  SPEED.BMP
Views: 0
Size:  68.9 KB


The listbox is hidden until the ownerdrawn pushbutton is selected. So
far so good, but my listbox is displayed only up to the edge of the
dialog box which means it shows only two lines and doesn't extend into the
desktop area. I'd expect this default behavior due to the OS clipping
applications so they aren't overwriting one another.

But how did the original dialog get around this? I tried a few options
with WS_CLIP... SetWindowPos(HWND_TOPMOST... and also creating the
listbox at INITDIALOG time and have the parent be the desktop, but
so far it displays just the two lines. Any idea on this?

Thanks

René
Attached Images
 

Need to develop a GUI in activex contro to capture finger (biometrics) samplel

$
0
0
Hey Guys m totaly new to this thing... i need to know is it possible to create a gui with the help of activex control?
i knw u guys r still confused (as i am right now :p )
i need to know
1. How to invoke biometric framework of windows(7) via an activex control
2. How to design a GUI bye using activex control to capture the samples (finger samples)
3. and finally how to pass those captured samples to web services OR
how to pass parameters / values from activex control to web services....


phewww... lots of complications... :D

answer to any question will reduce the stress...



PS:- Developing a biometrics system in which user will prompt to install an activex control, which will invoke WBF and records the sample (finger samples) and pass them to the web service

Popup menus SubMenus overlapping

$
0
0
I am writing a program in c++ with the Win32 API I created a popup menu with multiple submenus the submenus open up fine but when I open one and go to another they just overlap each other
Heres a screenshot and my code

Name:  examplepic.png
Views: 0
Size:  28.0 KB


Code:

case WM_RBUTTONDOWN:
                {
               
                HMENU hPopupMenu = CreatePopupMenu();
                HMENU hSubMenu = CreatePopupMenu();
                HMENU hLetterMenu = CreatePopupMenu();
                HMENU hNumberMenu = CreatePopupMenu();
                HMENU hBrowserMenu = CreatePopupMenu();
                HMENU hToggleMenu = CreatePopupMenu();
                HMENU hFunctionMenu = CreatePopupMenu();
                HMENU hMediaMenu = CreatePopupMenu();
                HMENU hComboMenu = CreatePopupMenu();
                HMENU hMouseMenu = CreatePopupMenu();

               
                AppendMenu(hPopupMenu,  MF_STRING | MF_POPUP, UINT_PTR(hLetterMenu), L"Letter Keys");
                AppendMenu(hPopupMenu,  MF_STRING |MF_POPUP, UINT_PTR(hNumberMenu), L"Number Keys");
                AppendMenu(hPopupMenu,  MF_STRING | MF_POPUP, UINT_PTR(hToggleMenu), L"Toggle Keys");
                AppendMenu(hPopupMenu,  MF_STRING | MF_POPUP, UINT_PTR(hMediaMenu), L"Media Keys");
                AppendMenu(hPopupMenu,  MF_STRING | MF_POPUP, UINT_PTR(hFunctionMenu), L"Function Keys");
                AppendMenu(hPopupMenu,  MF_STRING | MF_POPUP, UINT_PTR(hComboMenu), L"Combo Keys");
                AppendMenu(hPopupMenu,  MF_STRING | MF_POPUP, UINT_PTR(hMouseMenu), L"Mouse Buttons");

                for(int j = 0; j < 26; ++j)
                {
                        AppendMenu(hLetterMenu,  MF_STRING , 0,letterarray[j]);
                }

                for(int j = 0; j < 10; ++j)
                {
                        AppendMenu(hNumberMenu,  MF_STRING, 0,numberArray[j]);
                }

                for(int j = 0; j < 8; ++j)
                {
                        AppendMenu(hMediaMenu,  MF_STRING, 0, mediaArray[j]);
                }

                for(int j = 0; j < 5; ++j)
                {
                        AppendMenu(hMouseMenu,  MF_STRING, 0, mouseArray[j]);
                }

                for(int j = 0; j < 12; ++j)
                {
                        AppendMenu(hFunctionMenu,  MF_STRING, 0, functionArray[j]);
                }

                for(int j = 0; j < 3; ++j)
                {
                        AppendMenu(hToggleMenu,  MF_STRING, 0, toggleArray[j]);
                }

                SetForegroundWindow(ghMainWnd);
               
                GetCursorPos(&mouseposition);
                TrackPopupMenu(hPopupMenu, TPM_TOPALIGN | TPM_LEFTALIGN , mouseposition.x, mouseposition.y, 0, hWnd, NULL);
               
               
                return 0;
                }

the arrays are LPCWSTR arrays containing the strings to be drawn
Attached Images
 

problem outputing data from internetreadfile()

$
0
0
this is the code I'm having problems with(internetopen/connect and httpopenrequest all work):

Code:

DWORD bytesRead;
wchar_t temp[1025] = L"";
if (InternetReadFile(irequest, (LPVOID)temp, 1024, &bytesRead) == TRUE && bytesRead > 0)
{
        TextOut(hdc,700,100, (LPCWSTR)temp, sizeof(temp));
}

there is no error-code, but as output I get chinese sings, does anyone know what goes wrong?

Merging two Gdiplus::Bitmap into one c++

$
0
0
I'm trying to merge two Gdiplus::Bitmap and save result to disk.

pbmBitmap - is Gdiplus::Bitmap

At start i was trying to copy one bitmap into another and save copied bitmap to disk. Here is my code:

Code:

HBITMAP bitmapSource;
pbmBitmap->GetHBITMAP(Color::White, &bitmapSource); //create HBITMAP from Gdiplus::Bitmap

HDC dcDestination = CreateCompatibleDC(NULL); //create device contex for our destination bitmap
HBITMAP HBitmapDestination = CreateCompatibleBitmap(dcDestination, pbmBitmap->GetWidth(), pbmBitmap->GetHeight()); //create HBITMAP with correct size
SelectObject(dcDestination, dcDestination); //select created hbitmap on our destination dc

HDC dcSource = CreateCompatibleDC(NULL); //create device contex for our source bitmap
SelectObject(dcSource, bitmapSource); //select source bitmap on our source dc

BitBlt(dcDestination, 0, 0, pbmBitmap->GetWidth(), pbmBitmap->GetHeight(), dcSource, 0, 0, SRCCOPY); //copy piece of bitmap with correct size

SaveBitmap(dcDestination, HBitmapDestination, "OMG.bmp"); //not working i get 24kb bitmap
//SaveBitmap(dcSource, bitmapSource, "OMG.bmp"); //works like a boss, so it's problem with SaveBitmap function

It should work, but i get 24kb black bitmap.
SaveBitmap is my custom function, it works when i try save source bitmap.
Why i can't copy one bitmap to another??

using SendInput to control mouse for games

$
0
0
Hello, I am making a program to map keys and mouse input to 360 controller using XInput I have the keys working fine with SendInput my problem comes from when I try to control the mouse pointer with the analog stick heres the code I was using for down direction on the left thumbstick this code is inside the message loop.

Code:

if(controller1->GetState().Gamepad.sThumbRX > XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE)
          {
                                       
                                       
                                       

                               


              GetCursorPos(&mouseposition);

        mouseposition.x += controller1->GetState().Gamepad.sThumbRX/10000;
        ip.type = INPUT_MOUSE;
        ip.mi.dwExtraInfo = GetMessageExtraInfo();
        ip.mi.mouseData = 0;
        ip.mi.time = 0;
        ip.mi.dx = mouseposition.x *(65536/screen_x);
        ip.mi.dy = mouseposition.y *(65536/screen_y);
                                       
        ip.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;

                                       
                                       
                                       
        SendInput(1, &ip,sizeof(INPUT));

                                       
                                       
        }

the other directions generally follow the same idea.

it works fine outside of the stalker game im testing it with "not the best speed though" but in the game
if I move the thumbstick I get weird results. Example: Holding the thumbstickin the right direction and rotating on the game makes the movement stutter.

I have looked all over for an answer to why this happens but I cant find any examples of XInput with SendInput for controlling games.

Whats the problem and is there a better way than using SendInput?

How to call a C function (in the host process) from a DLL

$
0
0
Hi all
I have a main program that loads a dll and calls functions inside dll. Everything is fine.
Now I would like to call a function belonging to the main exe from the dll. I didi this:

main.c:
__declspec(dllexport) void HelloWorld(void)
{
printf("The function was called by dll! \n");
}

On dll, .cpp file, on top:
__declspec(dllimport) void HelloWorld(void);


On a dll method which is called from EXE I call:

int DLL_EXPORT Finalize(void)
{
exitCondition=0;
printf("Thread was killed\n");

HelloWorld();

return 0;
}


but compiler says:

...\main.cpp|59|undefined reference to `_imp___Z8HelloWorldv'|


How to solve this?

Thanks a lot

Alex

Problem with AllocConsole and child processes Windows 7

$
0
0
I have a GUI window that allocates a console using AllocConsole and then executes a child console process which should write to the console window I allocated. When I execute the program from the Start/Run menu or from a command prompt window,it works as expected. If I execute the program via the Windows Explorer or a desktop shortcut, the console window appears but nothing is written to it. I am using Windows 7 64bit. This problem did not occur under Windows XP.

I am setting the bInheritHandles to TRUE, setting STARTF_USESTDHANDLES flag in the startupifno dwFlags, and am setting hStdOutput to GetStdHandle (STD_OUTPUT_HANDLE).

Reliable way to detect whether Internet Explorer is 64 bit

$
0
0
On recent versions of Windows, Internet Explorer is a 64 bit process but by default tabs are spawned as 32 bit processes. It is up to the user to change Internet Options to enable full 64 bit mode.

I need a reliable way to detect whether a users Internet Explorer is configured to run in full 64 bit or 32 bit mode.

I'm stumped. Is this possible?

Cheers,
AnotherMuggle

[RESOLVED] C++ dialog listbox display outside the dialogbox

$
0
0
I'm trying to duplicate a listbox I saw in another application. It
looks like this:

Name:  SPEED.BMP
Views: 0
Size:  68.9 KB


The listbox is hidden until the ownerdrawn pushbutton is selected. So
far so good, but my listbox is displayed only up to the edge of the
dialog box which means it shows only two lines and doesn't extend into the
desktop area. I'd expect this default behavior due to the OS clipping
applications so they aren't overwriting one another.

But how did the original dialog get around this? I tried a few options
with WS_CLIP... SetWindowPos(HWND_TOPMOST... and also creating the
listbox at INITDIALOG time and have the parent be the desktop, but
so far it displays just the two lines. Any idea on this?

Thanks

René
Attached Images
 

edit control inside an edit control

$
0
0
I saw something that I'm trying to duplicate and I'm not sure how they did it. In a older application, Microsoft Mail 5.0, they embedded three edit controls into a multiline edit (MLE). At first, I thought MFC and a CDialogBar but given the date of the application (it carries an NE signature) it would be at best VC++ 2.0 and MFC 3.0 and I don't think the CDialogBar existed yet. Plus, going through the .EXE, it doesn't look like it links in a MFC*.DLL but it does use some vform.dll that I'm guessing is Visual Basic. So in short, it looks to be written in C/C++ with subclassing is my estimate but I could be wrong.

The app looks like this at start up:

Name:  MS1.JPG
Views: 0
Size:  19.8 KB

But as stuff is entered, the single line edits move up and scroll with the MLE or the user can tab back to the single edits like this:

Name:  MS2.JPG
Views: 0
Size:  33.3 KB

My edits either sit on top of the MLE and aren't part of it or when the MLE gets the focus, the cursor and whatever is being typed, is initially hidden by the "To" "Subject" and "Cc" controls. I've been making changes to the .RC and DialogProc but it not behaving as it should. Any ideas how they did this ?

René
Attached Images
  
Viewing all 583 articles
Browse latest View live