Cannot Print picture from a compiled DLL 
Author Message
 Cannot Print picture from a compiled DLL

I've devlopped an ActiveX DLL that prints some pictures.
The Woks fine if i'm in the VB Dev Environement, but if I Compile
the DLL the images come all black out of the printer.  They look
like a big black square filled with black.  Here is how I do it.

Dim TmpPicture as stdole.IPictureDisp
Set TmpPicture = LoadPicture("Filename.jpg")
Printer.PaintPicture(TmpPicture, X, Y)

As I said the picture prints well when i'm in debug mode
but when i use the dll alone the picture comes out all black!
I also tried to change the type of the TmpPicture.  I tried StdPicture,
Picture, IPictureDisp. No change.

Thank You

-----------------------------------
Eric Bouchard
MKS Informatique



Tue, 02 Jul 2002 03:00:00 GMT  
 Cannot Print picture from a compiled DLL
Eric,

I tested this and could not duplicate your problem... the compiled DLL
printed the jpg just fine.

I used stdole.IPictureDisp in a class w/ multiuse instancing

Public Sub PrintPicture(ByVal sPictureName As String)
    Dim TmpPicture As stdole.IPictureDisp
    Set TmpPicture = LoadPicture(sPictureName )
    Printer.PaintPicture TmpPicture, Printer.CurrentX, Printer.CurrentY
    Printer.EndDoc
    Set TmpPicture = Nothing
End Sub

Worked exactly the same in both dev & compiled states.

Brian A. Manlove
Magenic Technologies Int'l.



Tue, 02 Jul 2002 03:00:00 GMT  
 Cannot Print picture from a compiled DLL
Hi Brian

Just to notice you, i was calling the DLL from a webpage (javascript I used
the <object> tag).  I also tested with
Windows Host Scripting (i used WScript.CreateObject()) and didn't work
either.  Then, i tried to make a ActiveX EXE
instead and it is working fine, but thanks any way for trying to help.



Quote:
> Eric,

> I tested this and could not duplicate your problem... the compiled DLL
> printed the jpg just fine.

> I used stdole.IPictureDisp in a class w/ multiuse instancing

> Public Sub PrintPicture(ByVal sPictureName As String)
>     Dim TmpPicture As stdole.IPictureDisp
>     Set TmpPicture = LoadPicture(sPictureName )
>     Printer.PaintPicture TmpPicture, Printer.CurrentX, Printer.CurrentY
>     Printer.EndDoc
>     Set TmpPicture = Nothing
> End Sub

> Worked exactly the same in both dev & compiled states.

> Brian A. Manlove
> Magenic Technologies Int'l.



Fri, 05 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Printing a picture from compiled DLL

2. VB5 compiled module vs compiled DLL written in Visual C++ 5

3. compile error: cannot find project or library

4. Access 2000 cannot compile

5. Object Cannot Access Database After Compiled When Called From ASP

6. Cannot compile application after installing VS6

7. Help...Cannot compile my app

8. VB6: cannot compile project with ADO data objects

9. VB6: cannot compile project with ADO objects on second machine

10. active-X DLL - Helpfile not found using the compiled dll

11. Print to Picture and then saving the new picture

12. Error: pdsodbc.dll not found, 20532 cannot find database dll

 

 
Powered by phpBB® Forum Software