|T O P I C R E V I E W
||Posted - 04/30/2005 : 01:10:36
I am trying to get VB.NET to work with this control. It appears to do exactly what I need for the price I can spend. But the compile has hung up twice and once I have had to shutdown vstudio. The VB 6 app runs fine and I have twittled around with it already. But my app must run in VB.NET. Do you have some sample app that runs this?
I am surprised there is not one here. This leads me to think it doesn't work.....however if it does I will post one, the port of your app that is.
|5 L A T E S T R E P L I E S (Newest First)
||Posted - 05/04/2005 : 02:55:34
Once you said you got it working, I refused to surrender and finally found my bozo move : I did a mistake and forgot to a NEW a preview before I used it. It would run but not preview anything.
However after that I put in some code and it just fried the IDE. This was the "WaterMark". Don't use it no matter what ;) Something in that .watermark is down right deadly to the IDE.
Once I new'd the object and shutdown the app, it seems so much better.
Hints I got:
Once it stops compiling, cancel the build and quit. No use in doing anything else.
Intellsense will work if you have not screwed up the compiler. If it is not working, it will not compile anything or fix anything either. Figure out what you did wrong - then save and get out. Don't even bother rebuilding or building. Figure it out and save.
Edit your vbproj files if you are adding and removing the OXC becuase its not working for you. TerryW said to stick with the dll for VB.NET. If you mess around adding references, go into the XML and remove the others. Only have one in there.
Everything seems to be working so far. Great!
||Posted - 05/03/2005 : 18:04:21
There are some things you need to change to get PrintPreview to work correctly in VB.NET.
Colors: vbBlue is a VB6 constant and is not in VB.NET you will have to use something like the following:
Preview.ForeColor = System.Convert.ToUInt32(System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Blue))
If you try to use the WaterMark it will hang the editor.
Passing of the CurrentX or CurrentY values into the ParaText method will cause some problems and you will have to define a new variable to these and pass those into the method.
Dim CurrentY As Int32
CurrentY = Preview.CurrentY
Preview.ParaText("<ce>HV WINDING CONTINUED ON NEXT PAGE", , CurrentY)
but passing it into the AddTextAt method seems to work OK.
Preview.AddTextAt(Buffer, Preview.CurrentX, , , PrintPreview5.eAutoStep.prASCopypage)
When using the AddTextAt method and you need to pass one of the "pr" paramters along with it , you will have to do something like this:
Preview.AddTextAt(" ", , , , PrintPreview5.eAutoStep.prASCopypage)
You may find that you need to experiment around a little to get everything to work properly. But sofar everthing seems to work except for the WaterMark.
||Posted - 05/01/2005 : 16:07:47
I edited out the ocx in the vbproj and made sure only the dll was present.
I get the following message box whenever I use more than about 5 lines inside a
"Visual Basic .NET is unable to recover from the following error: System Error &HC00000005& Visual Basic Internal Compiler. Save your work and restart Visual Studio .NET"
Also these prSTExternal (the pr's) and vbBlue (vb's) are not defined. Are these vb6 defines?
||Posted - 04/30/2005 : 16:03:04
These wild errors include -
Compile doesn't get an error, but never returns.
You lose the reference and the smart editor no longer works. It no longer fills in the text for you or knows anything at all.
You have to close the application and restart .net.
||Posted - 04/30/2005 : 16:01:20
1) Add a reference worked. I can add either the ocx or the dll.
2) "Imports PrintPreviewOCX.PreviewClass" or the dll statement works also.
3) "Public WithEvents Preview As PrintPreviewOCX.Preview" works too.
4) "With Preview" & "End With" and then using some of the fields like the example has (in fact I copied some of the button click examples out) causes wild errors in the .NET compiler.
This is VB.NET running VB on .NET 2003 environment, .net Framework 1.1