Unregistered
October 28, 2002, 06:21:15
I am trying to write a DLL to print the selected TX document. I can't however figure out how to create a reference to TX that will allow for this to occur.
I am rather new to DLL programing, I generally only to User interface stuff, and then you have nice easy to find controls on your screen.
Anyone have a suggrestion on how I should go about this.
This message was originally posted by Matt in the old TX Text Control Support Forum.
Unregistered
October 28, 2002, 12:31:10
Matt,
I did this to see if I could programme my way round a memory problem.
I created an Activex Dll and put all the textcontrol related stuff on the dll form. This worked well and happily unloaded and loaded the controls. Memory usage was ok but I hit the wndtls32 problem and dropped the solution.
I couldn't figure out how to get the thing to work either and found the following on tek-tips.
Here's a sample. Create a new ActiveX DLL project, and in the code window type the following:
Option Explicit
Public Sub AddOne(ByRef A As Integer)
A = A + 1
End Sub
Go ahead and build the DLL by clicking "Make Project1.dll..." off the File menu.
Now create a new Project -- A Standard EXE one. Bring up the project explorer from the View menu. In the project explorer window, click on "Project1(Project1)" (should be in bold). In the properties window (make it visible off the view menu), change the name of the project from "Project1" to "Project2". This is to avoid a name conflict with your .DLL.
Click on "References..." on the Project menu. If you browse through the list, you'll see your Project1 that you created. Check the checkbox, and your new .exe project will be able to refer to the .dll you created earlier. Now, double-click on the form to bring up the code window. In the Form_Load event, add the following code:
Option Explicit
Private Sub Form_Load()
Dim x As New Project1.Class1
Dim SomeNumber As Integer
SomeNumber = 41
Call x.AddOne(SomeNumber)
Debug.Print SomeNumber
End Sub
In the output window you should see "42".
Explanation by Chip in thread "How to create a DLL file in VB6" in VB forum.
This message was originally posted by Peter Meachem in the old TX Text Control Support Forum.