Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using a third party DLL
#1
One of the windows I need to talk to is of class Ter32Class which apparently is a TE Edit Control, an editor that doesn't inherit from the standard RichText Control and so doesn't respond to EM_*** commands the way I'd hoped for.

The published method of talking to this control is via it's DLL
Here is the visual basic declaration needed to access one function in the DLL.

Public Declare Function TerSearchReplace Lib "ter14.dll" (ByVal hWnd As Long, ByVal SearchText As String, ByVal ReplaceText As String, ByVal flags As Long, ByVal StartPos As Long, EndPos As Long, BufSize As Long) As Long

How can I translate this to QuickMacros?
Where is the appropriate place for me to place the needed declarations?
Should I make a new folder within SYS?
Is this what the User folder is for?

Thanks
#2
Declaration and calling example

Code:
Copy      Help
dll "ter14.dll" #TerSearchReplace hWnd $SearchText $ReplaceText flags StartPos *EndPos *BufSize

int i ep bs
i=TerSearchReplace(hwnd "find" "replace" 0 0 &ep &bs)

I think (almost sure) you can use this function only if the control is created in QM context, not in other program, even if you would try to use shared memory.

Declaration can be placed in any place that would be executed before calling. For example, can be in same function, or in caller, or in a function that was executed previously.
#3
Thanks for the quick reply. How do you find the time to help us all?

Quote:I think (almost sure) you can use this function only if the control is created in QM context, not in other program, even if you would try to use shared memory.

Just for my education, why wouldn't the function work outside of a QM context using share?
Is this a Windows issue or a Quick Macros thing?
#4
Usually only SendMessage and similar functions can be used to communicate with windows in other processes. I don't think that TerSearchReplace is designed to work between processes. If it can, it itself should marshall all 4 pointers (shared memory is not required). Using shared memory is not common.


Forum Jump:


Users browsing this thread: 1 Guest(s)