473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Creatin Ocx

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?

Jul 21 '05 #1
2 1905
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
"Savas Ates" <sa***@indexinteractive.com> wrote in message
news:#y**************@TK2MSFTNGP12.phx.gbl...
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?

Jul 21 '05 #2
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?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Savas Ates" <sa***@indexinteractive.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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?

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Bates | last post by:
I am getting the below error , which is stopping VS from creating the classes for the reports I add. When I add a Crystal Report.NET to a project in Visual studio enterprise developer 2003, I...
2
by: ERI1618 | last post by:
I am trying to create a table in Access but i have a syntax error: I just want to crate a table with default values for excample create table test (column1 Text(20) DEFAULT 'This is a test') ...
0
by: Solunac | last post by:
Hi, everyone, I am new here ... I have a problem to create a after-trigger (update). Example tables: CREATE TABLE R ( log_num SMALLINT NOT NULL, int_num SMALLINT NOT NULL,
2
by: punitshrivastava | last post by:
Hi to All. I am Punit Shrivastava.I am working in Asp.As i am new in this technology please help me. I want to create enquiry form in Asp. For this i code like this: <form name="enquiry"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.