|
Are you saying tht you're spawning an external program and waiting for the return code from that program or are you trying to set the return code when your app terminates?
RageInTheMachine9532
|
|
|
|
|
if you are using VB6, you want to use the ExitProcess API call
Private Declare Sub ExitProcess Lib "KERNEL32" (ByVal uExitCode As Long)
normal end:
ExitProcess 0
useful if you run your app from a batch file or shell and wait for it to finish from another app
|
|
|
|
|
Hi All,
I am making an Add-In for Word using VB. I have made a file menu option and a Toolbar. in File menu option I added a CommandBarButton. In Toolbar also, I add a button (same as for file menu option).
I am using a gif file as an image for the buttons. To add the transparent image on to the button, I am using the code of MSDN. The code is working fine for all the OS except Windows 98/ME. In these OS the image comes with the white background.
My image have the transparent background.
Does anybody have any idea about it ?
Please reply soon.
Thanks and Regards
|
|
|
|
|
Hi,
Any idea how to get this? I've tried searching @ http://research.microsoft.com without success. Latest version if possible but any other will be appreciated. Thanx
1fm1fu
|
|
|
|
|
There is no source code for the ".NET Framework" as you put it. But, what I think your actually looking for is the Shared Source for the Common Language Infrastructure and SOME source for the C# compiler. This can be found here[^].
RageInTheMachine9532
|
|
|
|
|
Can someone PLEASE tell me why this won't work?
******** Declarations ******** <br />
<pre>Private Declare Auto Function BitBlt Lib "GDI32.DLL" ( byVal hdcDest As IntPtr, ByVal nXDest As Integer, _<br />
ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As Long, ByVal <br />
nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As Int32) As Boolean<br />
<br />
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, _ <br />
ByVal dwImageType As Long, ByVal dwDesiredWidth As Long, ByVal dwDesiredHeight As Long, ByVal dwFlags As Long) As Long<br />
<br />
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long<br />
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long<br />
<br />
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long<br />
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long</pre><br />
<br />
******** Consts ******** <br />
<pre>Private Const LR_LOADFROMFILE = &H10<br />
Private Const IMAGE_BITMAP = 0<br />
Private SRCCOPY as Integer = &HCC0020</pre><br />
<br />
<br />
******** Sub that won't work ******** <br />
<pre> Private Sub ShowPicture(ByVal File As String)<br />
Dim MemBmpHandle As Long<br />
Dim MemHdc As Long<br />
Dim Result As Long<br />
'<br />
MemBmpHandle = LoadImage(0, File, IMAGE_BITMAP, 776, 84, LR_LOADFROMFILE)<br />
MemHdc = CreateCompatibleDC(0)<br />
Result = SelectObject(MemHdc, MemBmpHandle)<br />
' <br />
Dim Grp As Graphics = PictureBox1.CreateGraphics ' Creating graphics object to BitBlt on<br />
Dim TargetDC As IntPtr = Grp.GetHdc() 'Creating target HDC<br />
'<br />
BitBlt(TargetDC, 0, 0, 776, 84, MemHdc, 0, 0, SRCCOPY) ' Blitting'<br />
<br />
Grp.ReleaseHdc(TargetDC)<br />
Grp.Dispose()<br />
DeleteDC(MemHdc)<br />
DeleteObject(MemBmpHandle)<br />
End Sub
Fade (Amit BS)
|
|
|
|
|
I want to create one primary solution that uses multiple projects
like 1 application and some class libraries,
now when i tried to add the projects into the solution they all load up but i can use the namespaces between the projects, why is that?
Note that i can easily use the *.dll files by refference but i want to use it all through code...
by the way, i have set all of the projects' Root Namespace setting to the same name space.
please help here, thanx
Fade (Amit BS)
|
|
|
|
|
I got this solved, for anyone who wounders this is the deal:
you add the projects to the solution (right-click the solution and then 'add'->'Existing Project'
then you have to create a refference.
what i didn't notice before that in the 'Add Reference' dialog there is a 'Projects' Tab, you add a refference to the project from there, and the IDE will automatically create a dependancy.
Another thing to notice, click on the project reference item, and in the properties window there is a 'Copy Local' property, i think that it's best to set this proerty to 'False'.
That worked for me just great, namespace work and everything.
Hope this will help someone
Fade (Amit BS)
|
|
|
|
|
Now this is a tricky one, as i am puzzeled about this,
i got BitBlt all figured out, i even wrote an article on how to use it HERE[^]
BUT!
It won't work if the source is not on the screen itself
you cannot use this code:
Dim tmpBitmap as new BitMap(...,...,)<br />
tmpGraphics = Graphics.FromImage(tmpBitmap) < graphics object
Now- Drawing to the Bitmap
tmpGraphics.DrawString("Hellow World!",myFont,myBursh,0,0)
Now Bliting
tmpHdc = tmpGraphics.GetHdc() < create a device context
BitBlt (TargetHdc ... tmpHdc )
it just wont work, it treats the source Hdc as an empty area in the memory, getting a blank image.
Note that if i'm coping from a context that is on the screen everything is working just fine, and then i can use the context in memory to copy to and from, but if i want the originating image to be created in memory and then use it? i don't like the idea of loading and drawing images to the screen in order for me to use them
Nothing worked for me and i have tried a lot of things.
You can download the code i'm using to BitBlt things, it's a class i worte, again here[^] it copies and pastes.
Any Ideas?
Fade (Amit BS)
Fade (Amit BS)
|
|
|
|
|
Hi,
This is my first post since I signed up today.
I would like to know as how should I proceed if I need to create a system tray in VB so that it can connect to my website.
You can see an example here of a similar software here:
http://www.helpcenterlive.com/winapp.php
The author of the program has created it to communicate with the Web Based live support system which he himself has developed.
I have downloaded the file and it contains files with extensions :
*.ocx
and found out following about the extension at:
http://filext.com/detaillist.php?extdetail=OCX
I would like to know if this could be achieved in VB. I have a site which is a Content Management Site and I would like to connect it with the program on my windows so that I can note as how many members have joined and how many stories have been published without opening up the browser.
Also, can you point me to the right direction as how to develop a Toolbar for a website which would run in IE browser such as Google Toolbar.
I have done programming in VB6 and Database programmingin pl/sql.
How different is VB .NET from VB6?
|
|
|
|
|
Just a basic side note, the OCX file is a component you can use,
just add a refference to it in yout .Net (or VB6) project, and then you would be able to use it.
And one major difference between VB6 and VB.Net is the intensive OOP that VB.Net offers, the CRL (Common Run-Time Language) usage, and multi-threading and much more, you can read all about it in the MSDN.
Fade (Amit BS)
|
|
|
|
|
I will be using VB .NET. So Is there a path which I have to take to develop
a Windows Application so that I wont have to go to my website through the
Browser rather do all my changes and updates from the Application.
For eg. look at http://pages.ebay.com/turbo_lister/
Turbo lister which is an application through which you dont have to go to
ebay's website to sell products. You can login to your account from the
Application and make changes and sell etc etc.
This is what I want to achieve in order to control the whole Administration
Section of my Website.
Where should I start to acheive this. Is there any book, any website , any
tutorial's to learn.
What exactly is this called. Is it VB Net Programming, or Web Services , or
Window Forms Programming etc.
I need to have a better understanding in order to acheive the above, where
shoudl I start.
I have access to these three Books:
1 ). Addison Wesley Windows Forms Programming In Visual Basic Dot NET
2). MS Press 101 Microsoft Visual Basic Dot NET Applications
3). MS Press Microsoft Visual Basic Dot NET Step By Step Version.2003
Are the above books enough to begin with or am I off the track. I really
dont know what to look for.
|
|
|
|
|
Sorry, this doesn't answer your question but it's a problem on a related note:
when I use this in the Paint event of a form the program hangs when I call DrawString
<br />
Dim bmp As New Bitmap(Me.ClientSize.Width, Me.ClientSize.Height, e.Graphics)<br />
<br />
Dim hdc As IntPtr = e.Graphics.GetHdc()<br />
<br />
Dim gMem As Graphics = Graphics.FromImage(bmp)<br />
Dim memHdc As IntPtr = gMem.GetHdc()<br />
'<br />
gMem.DrawString(drawString, drawFont, drawBrush, x, y)<br />
<br />
Dim SRCCOPY As Integer = &HCC0020<br />
<br />
BitBlt(hdc, 0, 0, Me.ClientSize.Width, Me.ClientSize.Height, memHdc, 0, 0, SRCCOPY)<br />
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Don't worry, I've just worked it out
Dim memHdc As IntPtr = gMem.GetHdc() was in the wrong place
I knew as soon as I posted this I would solve it
Rugby League: The Greatest Game Of All.
|
|
|
|
|
How can I center text on a form using the Graphics.DrawString method?
Using C++ I would write:
pdc -> DrawText(cs,cr,DT_CENTER | DT_VCENTER | DT_SINGLELINE);<br />
where cs is the string to write and cr the bounds rectangle. Is there a similar method in .NET?
Ican write in the form easily enough but I want to center the text in the middle of the form, also how doI stop it flickering when it repaints it?
Thanks in anticipation.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
See the Graphics.DrawString method. You may also have to center the image on the form yourself. To get the length of the drawn string use Graphics.MeasureString
RageInTheMachine9532
|
|
|
|
|
Thanks, got that working. Is there anyway to stop the flicker?
Rugby League: The Greatest Game Of All.
|
|
|
|
|
You did not mention when do you see it flicker (i.e. When do you re-redraw,
In what rate and how many objects etc.)
Fade (Amit BS)
|
|
|
|
|
Essentially i am using forms as controls on a parent form - i draw some text on the child forms in the Paint event because the forms can be resized - it flickers when I resize it.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Hi every body!
please tell me how can i get a data type of a field in data base!!!
Thanks!
xyz
|
|
|
|
|
I have not done it in .Net yet but in the old VB you need to set a reference to: 'Microsoft ADO Ext. 2.7 for DDL and Security'. You many have another version than 2.7 but you get the idea.
Dim cn As ADODB.Connection
Dim sch As New ADOX.Catalog
cn = New Connection
cn.ConnectionString = ConnectString
cn.Open
sch.ActiveConnection = cn
Dim t As ADOX.Table
Dim c As ADOX.Column
Set t = sch.Tables("TableName")
Set c = t.Columns("ColumnName")
Debug.Print c.Type
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
Does anyone here know a way i can draw over a picture box?? And i mean draw (anything such a rectangle or so), not place a picture!
-----------------------
Toola
|
|
|
|
|
In VB.Net you can draw on almost anything, using this simple syntax:
Dim MyGraphicsObject as Graphics ' Creating a graphics object Holder<br />
MyGraphicsObject= PictureBox1.CreateGraphics ' Getting a graphics <br />
' object for the PictureBox
Note that you can create a graphics object using the .CreateGraphics on almost anything
and for images use :
MyGraphicsObject = Graphics.FromImage(MyImageObject)
to get a refference to a graphics object.
now you can do whatever you want, like
MyGraphicsObject.DrawArc
Or
MyGraphicsObject.DrawRectangle or .DrawString
and so on.
just dont forget to use
MyGraphicsObject.Dispose()
when you're done
Fade (Amit BS)
|
|
|
|
|
I have got Vb 6.0 and applying for that I want DAO connection. But I unable to connect. what may be the problem??? Is DAO is not allowed for VB6.0?? May be the problem with the code...! What is the code..????
|
|
|
|
|
hi when i built the solution, it complies well but when running it gives an error, unable to start the debugger. please repair or reinstall the debugger. anybody having any idea, whats the problem. i have reinstalled and repaired vs.net more than once but problem is till there. i m using vs.net2003. thanks in advance.
|
|
|
|
|