Creatin Ocx

S

Savas Ates

Public Function CreateImage(path, size, font, xpos, ypos, color, text)
Picture1.Picture = LoadPicture(path)
Picture1.AutoRedraw = True
Picture1.FontSize = size
Picture1.font = font
Picture1.CurrentX = xpos
Picture1.CurrentY = ypos
Picture1.FillColor = color
Picture1.Print text
End Function

Private Sub UserControl_Initialize()
CreateImage "c:\10bt.jpg", 20, "Verdana", 50, 50, 120000, "SALL"
End Sub

My Vb application is like above

i saved it sates.vbp and sa1.ctl name of user contols is also sa1

i compiled it sates.ocx

in asp page
i tried it

<%
set xx=server.CreateObject ("sates.sa1")
%>
error
ASP 0241 (0x80004005)
creating ('null') object c0000005 (access violation )

<%
set xx=server.CreateObject ("sates.sa1")
%>
error
ASP 0177 (0x800401F3) Invalid ProgID

how can i solve this problem and use this ocx with parameters of my
function.. help me?
 
J

Jeff Dillon

Try to use it in another VB project to make sure you get the ProgID correct.
Ctrl-Alt-J to see the Object Browser might help

Jeff
 
M

Mark Schupp

Is Picture1 a dialog control? If so I suspect that it requires a window in
order to be instantiated.

Try commenting out the CreateImage call in the initialize function. If
createobject does not give an error in the ASP page then that is probably
the case. VB objects which require a UI do not work in ASP be cause there is
no display context available. Exactly what are you trying to do?
 

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,897
Members
47,439
Latest member
shasuze

Latest Threads

Top