• Welcome to Valhalla Legends Archive.
 

RichTextBox

Started by FrOzeN, May 28, 2007, 03:45 AM

Previous topic - Next topic

FrOzeN

hWndEditBox = CreateWindow("EDIT",
                           "Edit Boxes",
                           WS_VISIBLE | WS_CHILD,
                           10,
                           10,
                           100,
                           50,
                           hWnd,
                           (HMENU)IDC_EDITBOX_TEXT,
                           (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE),
                           NULL);

The above code creates a Edit Box (Textbox) in C++. Does anyone have similar (or even an entire class) code to create a RichTextBox (and possibly post their AddChat procedure too). I need to add a RichTextBox to a program I'm making in VB6 and cannot use the .ocx control due to restrictions on how I'm doing the rest of the program. So I'll just convert the C++ code over, and modify it accordingly. Thanks.
~ FrOzeN

Barabajagal

Just figure out how to use the RichEd32 or RichEd20 dlls? It's not that hard, and more powerful than the ocx anyway.

FrOzeN

Basicly, in my VB6 project I'm trying to create and use a RichTextBox on the form using only the API. Being that I figured out how to do all the controls using the C++ equivalent so far I figured it might be the same with the RichTextBox. After some further searching I found it, turns out RichEdit is what I was after.

http://tek-tips.com/viewthread.cfm?qid=826090

I'd still appreciate to see code for the AddChat in C++. Save me looking up all the .SelLength, .SelText, etc. individually to rewrite.
~ FrOzeN

Warrior

API calls are API calls. They're not language specific. It's a waste of time doing it in C++, if your target language is VB6 do it there from the get go.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

FrOzeN

Actually, I think it's much easier if I do it by getting the C++ code and converting it over. I can't even find a single source or really any helpful information about how to create controls and such with API in Visual Basic. I used this C++ tutorial to build to basic form and just converted the code over as I did it.

As many people in C++ would have used a RichEdit box it's much less hassle using their code as reference to what needs to be done, rather than fiddling around trying to find out all the calls and such that are needed to work with it in VB6.
~ FrOzeN

Warrior

You call the APIs..and handle the results..what's not to get?
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

FrOzeN

There isn't any documentation for it in VB6, as almost all VB6 users use the .ocx control. Therefore I figured a fair amount of users would of done it in C++ without the use of MFC which can be very helpful to me as it's quite simple to convert over. It's quicker than having to go over all the MSDN documentation on it which is in C++ anyway.
~ FrOzeN

Warrior

You're right, it's easier to port when you have existing C++ code, thats a given. However if you're going off of nothing, explicitly writing it in C++ just to convert it has little or no benefits.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Zakath

#8
An example that created a RTB in C:


//somewhere where it will be run once when the program starts up
HMODULE hmodRTB = LoadLibrary( "RICHED20.DLL" );

//when you want to create the window
HWND hwndRTB = CreateWindowEx( NULL, RICHEDIT_CLASS, (LPCTSTR)NULL, WS_CHILD | WS_VISIBLE | ES_MULTILINE, 0, 0, 400, 200, hwndMain, (HMENU) (int) (ID_RTB), hInstance, NULL);

//right before the program exits
FreeLibrary( hmodRTB );
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.