|
Hi,
I tried to port your code into my application and want to use the "print" feature. However I got "Run time error 91 -- Object variable or with block object not set" with the following code line:
Private Property Get hWnd_Frame() As Long
Dim TWnd As New TWindow
TWnd.hWnd = frmMain.hWnd
TWnd.hWnd = TWnd.FindChildWindowByClass("ATL:", False).hWnd '******Problem occured here**********
If Mid$(TWnd.ClassName, 9, 4) = "2748" Then
TWnd.hWnd = TWnd.FindChildWindowByClass("ATL:", False).hWnd
If Mid$(TWnd.ClassName, 9, 4) = "2070" Then
TWnd.hWnd = TWnd.FindChildWindowByClass("AfxFrameOrView42").hW nd
hWnd_Frame = TWnd.hWnd
End If
End If
End Property
I did set:
Set obiMap = New MapPoint
Set Map = frmMain.MappointControl.Activemap
before I call
objMap.SendCommand MapPointMenu.mnuFile.cmdPrint
Do you have any clues? Any suggestions are appreciated very much!
Thanks, |