resedlar
asked on
Calling a form within a DLL
This is a follow up of question:
https://www.experts-exchange.com/questions/20814217/Problem-with-Picturebox-in-VB-6-0.html
I need to get vector information from a database, transform it into an image, save the image to a file (with a random filename), pass some database information as well as the filename of the image file to a web page for display. (I will have another routine clean up the files so that there isn't a disk space problem)
I currently have two VB projects that do the following:
1) A DLL that will return the needed data from a database. (I can call this DLL from a web page and display the data)
2) A project that has form that can transform the data into an image and save it to a file. (If I hard code the data I can run the project and create an image file)
I need to know:
A) How to pass the database information to the form (the data needed is a char(20) and an variable size array of char(60))
B) How to pass the filename of the created file back to the DLL and then back to the web page that will display the image
I'm not sure if I need to create an Executable from the project (number 2) and run it from the DLL. Or if I need to include the form in the DLL and call it internally.
Urgent help is needed. (I will only be in the office till 11:00 am EST and not back until Monday 12/8 and I'd like to have this working before I leave)
https://www.experts-exchange.com/questions/20814217/Problem-with-Picturebox-in-VB-6-0.html
I need to get vector information from a database, transform it into an image, save the image to a file (with a random filename), pass some database information as well as the filename of the image file to a web page for display. (I will have another routine clean up the files so that there isn't a disk space problem)
I currently have two VB projects that do the following:
1) A DLL that will return the needed data from a database. (I can call this DLL from a web page and display the data)
2) A project that has form that can transform the data into an image and save it to a file. (If I hard code the data I can run the project and create an image file)
I need to know:
A) How to pass the database information to the form (the data needed is a char(20) and an variable size array of char(60))
B) How to pass the filename of the created file back to the DLL and then back to the web page that will display the image
I'm not sure if I need to create an Executable from the project (number 2) and run it from the DLL. Or if I need to include the form in the DLL and call it internally.
Urgent help is needed. (I will only be in the office till 11:00 am EST and not back until Monday 12/8 and I'd like to have this working before I leave)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks AzraSound,
I have made the changes to the DLL that you listed. Recreated the DLL and reinstalled it in COM+ I am now getting an error in my ASP page that reads:
Server object, ASP 0177 (0x80010007)
The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call may have executed.
/RealEstate/sketch.asp, line 49
Line 49 is the "set objDrawpicture=Server.Crea teObject(" MyDLL.Draw Picture") line.
I need to go to training for the rest of the week so, I'll not be able to debug again till Monday.
I have made the changes to the DLL that you listed. Recreated the DLL and reinstalled it in COM+ I am now getting an error in my ASP page that reads:
Server object, ASP 0177 (0x80010007)
The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call may have executed.
/RealEstate/sketch.asp, line 49
Line 49 is the "set objDrawpicture=Server.Crea
I need to go to training for the rest of the week so, I'll not be able to debug again till Monday.
ASKER
OK,
Now that I have actually closed Component services, I am getting an error on the "strFile = objDrawPicture.TransferToF ile(vMyDBD ata)" line:
Automation error
Now that I have actually closed Component services, I am getting an error on the "strFile = objDrawPicture.TransferToF
Automation error
Hard to say without some debugging. I assume vMyDBData is a variable actually containing the data you have pulled from your database?
ASKER
Typos, Typos, Typos. Now that I have fixed them everything is working great.
Thanks Azra
Thanks Azra
B. You are not passed as file name, open the file and read the content as pass the content as string
On the other end, just load the string to picturebox