|
First of all sorry for the late response. I have been away for a couple of weeks.
ReorX wrote:
I'm sorry ...
Can you reproduce this or shall I post my bcl-configuration?
Don't be sorry, if there is a problem in my code I should be sorry. Anyway I am currently having some trouble with my Visual Studio installation. As soon as I have that fixed I will have a closer look at this problem.
I would appreciate it if you could send me your settings files. No need to post them, simply email them to baard25(at)zonnet(dot)nl.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Has anyone been able to get the OCX working in VB6?
If so, any chance you could provide a basic sample?
|
|
|
|
|
What exactly are the problems you are having? If you install brainchild as explained in the article and you copy the OCX in the directory where brainchil.dll is located and you register the ocx (regsvr32.exe) all should be fine.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Hi Jan,
THe control looks great and it seems to do all I want for SQL scripts. My question is regarding using the control in VB6. If I understand it correctly, I need to do the following:
1. Create a folder C:\VBProject
2. Save the dll, cpl and ocx in this folder.
3. Copy the Defaults folder in VBProject folder.
4. Update the registry to point to the location of the Default Folder
5. Register the ocx control
6. Reference the control in teh VB project
7. Add the control to a Form.
At this point, how do I set the langauge to be SQL, set linenumbering to true, add bracematching etc.? Do I need to bring up the configuration editor? How can I do that?
The help file states
"The brainchild package includes next to the control itself also a program to configure brainchild. This program, when installed, will add an entry in your control panel called "Brainchild Configurator". With this program you can control the options and settings of the brainchild control."
While I can invoke the config editor from the demo program, I am not sure how to link the Configurator to the control on the Form in my VB6 application. Also, I do not see the configurator in the Control Panel.
Please suggest.
Thanks
Shakti
|
|
|
|
|
Shakti Goel wrote:
THe control looks great and it seems to do all I want for SQL scripts. My question is regarding using the control in VB6. If I understand it correctly, I need to do the following
1. Create a folder C:\VBProject
2. Save the dll, cpl and ocx in this folder.
3. Copy the Defaults folder in VBProject folder.
4. Update the registry to point to the location of the Default Folder
5. Register the ocx control
6. Reference the control in teh VB project
7. Add the control to a Form.
Actually you can do not need to copy the brainchild stuff into the VB project directory. You can copy it into it's own directory anywhere on your hard disk. You need update the registry to point to the settings folder in which the Defaults directory is located. I.E. if you have a directory structure like this:
C:\
Brainchild
Settings
Defaults
you should point the registry key to "C:\Brainchild\Settings". For the rest (registering, referencing etc.) should work as you described.
Shakti Goel wrote:
At this point, how do I set the langauge to be SQL, set linenumbering to true, add bracematching etc.? Do I need to bring up the configuration editor? How can I do that?
You do not need to do any setup to load SQL files. When you load a file into the control with the ".sql" file extention the control will automatically choose T-SQL highlighting. For extra settings like line numbering etc. you need to use the control panel applet.
Shakti Goel wrote:
The help file states
"The brainchild package includes next to the control itself also a program to configure brainchild. This program, when installed, will add an entry in your control panel called "Brainchild Configurator". With this program you can control the options and settings of the brainchild control."
While I can invoke the config editor from the demo program, I am not sure how to link the Configurator to the control on the Form in my VB6 application. Also, I do not see the configurator in the Control Panel.
Please suggest.
That line from the documentation is left over from the time brainchild still was distributed as an install package. This install package automatically installed the CPL into the system32 directory. If you want to be able to configure brainchild using the control panel you can copy the CPL and DLL in the System32 directory.
If you simply want to use the control panel applet from you VB application a simple call to the SettingsDialog() method of the OCX should suffice.
Enjoy,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Thanks Jan.
I was able to make the control work in VB and it looks great!
Some questions I had while writing the code after incorporating the control were:
1. I have an UNDO menu item. It seems that multiple undos and redos are built in the Brainchild control. What code would I write to perform an undo operation when I click the UNDO menu item (or REDO for that matter)?
I can use the SendMessageLong win32 API Function but I need the handler (HWND property) for the control. Also, some controls have the UNDO and REDO methods exposed which can then be called directly in the program. I looked ath the cpp code for the demo [I am not a cpp progrogrammer ] but sort of figured out you are making a Windows call to perform undo, cut, copy etc.
2. It will be great to have some more properties built into Brainchild that generally come standard with RichTextBox control and are very useful. They are:
Locked - true or false : If locked then you cannot perform edit in the control
BackColor - sets the backcolor of the control
3. I did not find the _change event but I think _cursorposition method does that. Right?
I think it will help very much if undo and redo calls can be exposed in the OCX.
Awesome work!!
Thanks.
Shakti
|
|
|
|
|
Forgot to ask...
when you package the application and add the control to it, what steps need to be taken..
I can think of
1. Add the .OCX and .dll in the ditribution
2. Distribute the T-SQL.bcp
I am not sure how the registry key for settings will be done by the installer. If I understand it correctly, we need to set the registry so that the OCX knows where the TCP-SQL is?
If I use loadparser method then do I still need to go through the registry step?
Thanks
|
|
|
|
|
Shakti Goel wrote:
Forgot to ask...
when you package the application and add the control to it, what steps need to be taken..
I can think of
1. Add the .OCX and .dll in the ditribution
2. Distribute the T-SQL.bcp
I am not sure how the registry key for settings will be done by the installer. If I understand it correctly, we need to set the registry so that the OCX knows where the TCP-SQL is?
You indeed need to include the control add and OCX in the distribution. You will probably also need to register the OCx with regsvr32.
Shakti Goel wrote:
If I use loadparser method then do I still need to go through the registry step?
I honestly can't say at the moment. Brainchild should run now without having to do the registry thing and loading the BCP file using the LoadParser() method should suffice. Just try it. If it does not work let me know.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
First of all my appologies for the late anwser. I have been away for a couple of weeks.
Shakti Goel wrote:
1. I have an UNDO menu item. It seems that multiple undos and redos are built in the Brainchild control. What code would I write to perform an undo operation when I click the UNDO menu item (or REDO for that matter)?
I can use the SendMessageLong win32 API Function but I need the handler (HWND property) for the control. Also, some controls have the UNDO and REDO methods exposed which can then be called directly in the program. I looked ath the cpp code for the demo [I am not a cpp progrogrammer ] but sort of
Calling Undo, Redo and quite a few other things can be accomplished through the ExecuteCommand() method of the OCX just pass it the ID of the command you want to execute. Look at the "brainchild_defs.h" file in the OCX sources to find the possible command codes. All defines starting with CID_ are valid for the ExecuteCommand() method. For Undo you would call:
ocxInstance.ExecuteMethod( 100 )
Shakti Goel wrote:
2. It will be great to have some more properties built into Brainchild that generally come standard with RichTextBox control and are very useful. They are:
Locked - true or false : If locked then you cannot perform edit in the control
BackColor - sets the backcolor of the control
Locked does not exist but you can set the control to readonly by setting the Readonly property. To change the background color of the control you can use the SetColor method. Use 1 (BCC_BACKGROUND in brainchild_defs.h) as the first parameter, the second parameter must be thr RGB value of the color to set.
Shakti Goel wrote:
3. I did not find the _change event but I think _cursorposition method does that. Right?
The controls fires several events. There is the OnCaretPosition event which get's fired when the caret (cursor) position changes. There is the OnStatusUpdate event which fires if the internal status of several flags change (see NMSTATUSUPDATE structure in brainchild_defs.h). Finally there is the OnFilenameChanged event which fires, like the name implies, when the filename has changed.
Enjoy,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Jan van den Baard wrote:
That line from the documentation is left over from the time brainchild still was distributed as an install package. This install package automatically installed the CPL into the system32 directory. If you want to be able to configure brainchild using the control panel you can copy the CPL and DLL in the System32 directory.
If you simply want to use the control panel applet from you VB application a simple call to the SettingsDialog() method of the OCX should suffice.
Is there any way to specify where the Brainchild.CPL file is located other than forcing it to be in the System32 directory?
It would be nice if the SettingDialog() method could look in the application path first, then maybe System32, that way a program that uses Brainchild doesn't have to add an item to the Windows Contro Panel.
Thanks,
Chris
|
|
|
|
|
FCBLogin wrote:
Is there any way to specify where the Brainchild.CPL file is located other than forcing it to be in the System32 directory?
It would be nice if the SettingDialog() method could look in the application path first, then maybe System32, that way a program that uses Brainchild doesn't have to add an item to the Windows Contro Panel.
Brainchild uses the LoadLibrary API to open the cpl so loading it from the application path should not be a problem. From the MSDN docs:
1) The directory from which the application loaded.
2) The current directory.
3) The system directory. Use the GetSystemDirectory function to get the path of this directory.
4) The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
Windows Me/98/95: This directory does not exist.
5) The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
6) The directories that are listed in the PATH environment variable.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Could you please correct the link to download ClassLib file.
Thanks
|
|
|
|
|
linhjob wrote:
Could you please correct the link to download ClassLib file.
The links in the article seem to work just fine. They re-direct to the classlib article where you can download the necessary files. What are the problems you are having?
- Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
The link is working now - Thanks
|
|
|
|
|
Hello
Well, i found some bugs in brainchild, hope you can fix them
1) Problem with URL's, when erassing a url (Backspace) the underline is still there, and gets erased after some moments.
2) Problem with positioning the caret, when selecting a line from the left side, the caret will change it's position to go in the next line.
3) Problems when exiting BCDemo, seems on some cases when i start editing the code, and tries to exit, it will not, so tasmanager comes in handy.
4) Problem with the tabs, when openeing more than one tab, the code for each tab does not change only the first code for the first tab gets shown in all tabs.
5) When double clicking on the code editor, on words, it chooses all the word, disregarding any symbols joined with it.
6) Caret keeps flickering when hightling code from the left side and keep highling code, either going upwards or downwards.
Not critical bugs, but some may affect the effeciency of it, hope i have helped , and keep up the good work Jan
|
|
|
|
|
asdf500 wrote:
1) Problem with URL's, when erassing a url (Backspace) the underline is still there, and gets erased after some moments.
This is not a bug. The parser will determine wether it is a hyperlink or not by the prefix of the hyperlink. For example when you type http://www.codeproject.com and you start deleting characters the parser still thinks it is a hyperlink until you remove any character from the "http:" part of the hyperlink.
asdf500 wrote:
2) Problem with positioning the caret, when selecting a line from the left side, the caret will change it's position to go in the next line.
This is normal behaviour. The caret will position itself at the end of the selection. Since clicking in the selection margin selects to whole line including cr/lf the caret is moved to the start of the next line. You will notice that Visual Studio does it the same way.
asdf500 wrote:
3) Problems when exiting BCDemo, seems on some cases when i start editing the code, and tries to exit, it will not, so tasmanager comes in handy.
This problem is known to me and is a bug in ClassLib, the C++ library which is used to write the BCDemo demonstration program. This is not a problem in brainchild.
asdf500 wrote:
4) Problem with the tabs, when openeing more than one tab, the code for each tab does not change only the first code for the first tab gets shown in all tabs.
I do not understand exactly what you mean here. Do you mean the title of the first tab get's copied on the other tabs?
asdf500 wrote:
5) When double clicking on the code editor, on words, it chooses all the word, disregarding any symbols joined with it.
Selecting a word by means of double clicking it will select the word up until the first white space or delimiter character. This means that double clicking on the wordt pMsg in a text pMsg->wParam will only select the pMsg part. This is normal behaviour.
asdf500 wrote:
6) Caret keeps flickering when hightling code from the left side and keep highling code, either going upwards or downwards.
I'll see what I can do about this.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Thanks Jan, for you speedy reply, well, not all bugs, but i did not know another word for them, language problem maybe, anyway, i think you misunderstood some point more specificly number 5, i meant this:
X = y[Index] double clicking on Index, will highlight [] aswell, this is what i meant, about problem number 4, is that when i choose a new tab - Untitled -, then try to open another tab from any existing file, tab names will remain the same and code will not change when changing tabs, thus only 1 code can be viewed.
About problem number 2, i still think it should not reposition itself to the next line, i have not seen VS do that, maybe you use another version than mine, and i come to a point where i see 2 highlighted lines, i don't really think this is normal.
Plus, when i mentioned there is a problem in BCDemo, i did not say it's in brainchild, but there is only 1 place to post such problem, which is the brainchild page.
Hope this clears it up for you, thanks in advance.
|
|
|
|
|
asdf500 wrote:
X = y[Index] double clicking on Index, will highlight [] aswell, this is what i meant
What parser (language) file is used? I cannot reproduce this behaviour over here. Does this also happen when you Ctrl+Click the word? Does the parser file have the square brackets in it's delimiters configuration?
asdf500 wrote:
about problem number 4, is that when i choose a new tab - Untitled -, then try to open another tab from any existing file, tab names will remain the same and code will not change when changing tabs, thus only 1 code can be viewed.
Not exactly sure what this problem is but it is probably related to the problem where BCDemo can't be closed anymore. This has a priority on my TODO list.
asdf500 wrote:
About problem number 2, i still think it should not reposition itself to the next line, i have not seen VS do that, maybe you use another version than mine,
I have seen this behaviour in VC 6, VS .NET 2002 and VS .NET 2003. Not sure about VS 2005 though... Still need to install beta 2.
asdf500 wrote:
and i come to a point where i see 2 highlighted lines, i don't really think this is normal.
When you click inside the selection/line-number margin to select a line and you do not drag the mouse then no, it should not select more than a single line. If however you keep the mousebutton down and you move the mouse up or down inside the margin more lines will be selected.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Yeap, that was it Jan, well, thanks much for your effort in hearing my reports , in the end i have only suggestions about brainchild, also, Code Folding/UnFolding is nice to have, intellisense and a browser feature where you can travel through code by function listing, anyway, that was really a very good job you have done in here, please keep up the goof work.
Best Regards
|
|
|
|
|
Some of you were having problems with the error "The application failed to initialize properly (0xc0000142).". This was due to the fact that the dll source code zip file did not contain the default settings files necessary to get brainchild up and running properly using the instructions in the article.
The dll source code zip file has been updated and now contains the correct files.
- Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
I am still getting the error after downloaded and recompiled all the files today. Starting BCDemo from Brainchild_Bin gives the same error.
Any suggestions? Thanks.
-- modified at 15:29 Wednesday 7th December, 2005
Never mind. Somehow the program is looking for a folder under Settings with the same name as user ID, not "Defaults".
|
|
|
|
|
h.lee wrote: Never mind. Somehow the program is looking for a folder under Settings with the same name as user ID, not "Defaults".
Actually the DLL creates the user directory and copies the contents of the Defaults directory in there the first time somebody uses a program using Brainchild, at least this is how it is supposed to work. If you had to create the user directory manually something is wrong.
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
The DLL did create the user directory. However, it did not put anything there and I have to copy the Defaults manually to make it work.
|
|
|
|
|
Hi
I've done you instructions to get it working, but I just get: "The application failed to initialize properly (0xc0000142). Click on OK to terminate the application."
What have I done wrong?
Cheers
|
|
|
|
|
This weekend the article was updated with a new dll source zip which has the default settings files in it. It is possible that you downloaded before this and were unable to follow step 8 from the instructions. If so please download the dll source zip and try again.
- Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|