|
I'm a .NET programmer who knows how easy it is to access special folders via the Application.CommonAppDataPath and System.Environment.GetFolderPath() members, but how does one do this in VB 6?
|
|
|
|
|
GetSystemDirectory API to get system directory
GetWindowsDirectory API to get windows directory
GetTempPath API to get temp directory
SHGetSpecialFolderLocation ,SHGetFolderLocation are also useful
look msdn for details
|
|
|
|
|
I am a C++ prgrammer but have very little VB experience.
Could someone help me with the following:
I have Win32 dll, and need to call a function from VB:-
code:--------------------------------------------------------------------------------
int WINAPI SCN_Open_Device(HWND, LPDWORD, LPSTR, LPSTR, LPSTR, LPSTR, LPWORD);
--------------------------------------------------------------------------------
I have declared the function as
code:--------------------------------------------------------------------------------
Declare Function SCN_Open_Device Lib "D:\My Projects\Development\Phillipines\VB1\scn_scsi.dll" (ByVal hwnd As Long, ByVal num_device As Long, ByVal vendor_model As String, ByVal product_version As String, ByVal periph_name As String, ByVal path_ini_file As String, ByVal dll_version As Integer) As Integer
--------------------------------------------------------------------------------
And called the function from Vb as follows:
code:--------------------------------------------------------------------------------
Dim Par1 As Long
Dim Par2 As String
Dim Par3 As String
Dim Par4 As String
Dim Par5 As String
Dim Par6 As Integer
Dim Result As Integer
Result = SCN_Open_Device(Form1.hwnd, Par1, Par2, Par3, Par4, Par5, Par6)
--------------------------------------------------------------------------------
But I get a crash.
Could someone tell me what I am doing wrong?
I guess my data types are incorrect ???
Eternally grateful to anyone who helps me
Rich
|
|
|
|
|
This might help, but the final five parameters are to be pointers and the only way to have VB pass a pointer would be in the function definition to use the clause 'ByRef' instead of using 'ByVal'. Having said that though, I suspect that 'String' types in VB are not the same as the 'string' types in C++. AFAIR I had to declare my C routine in the DLL as "pointer to a pointer to a type" in order to get things to work properly. Also I'm not sure whether the WINAPI is a std_call or not. The calling convention is pretty important to get correct for all these things to work.
Chris Meech
It's much easier to get rich telling people what they want to hear. Chistopher Duncan
I can't help getting older, but I refuse to grow up. Roger Wright
I've been meaning to change my sig. Thanks! Alvaro Mendez
|
|
|
|
|
I'm working on a class (.dll) that i'm willing to publish on the internet.I'm desiging the class in VB.Net and the thing is that i want the users who implement my class in their projects to see characteristics of the methods they're using when they point at them in the object browser window ( you know when u wanna use a method or a function u must understant its behavior).
I know that i can attach with my class a document file that explains the summary of the methods that class offers but i wanted it to be more prfessionnal.
So is there any way i can do this?
Joe Zeitouny
zeitounybros@hotmail.com
|
|
|
|
|
You can add your descriptions using attributes directly in your code. But, you still might want to include a documentation file of some kind to be complete.
Search in the help for Visual Basic.NET for 'Attributes and Design-Time Support' for how to add descriptions and whatnot to your code.
RageInTheMachine9532
|
|
|
|
|
Does anyone have vb.net code to kill a window using win32 api?
|
|
|
|
|
What do your mean by 'kill a window'?
If your looking to kill a 'window', you can't.
If you mean kill the process that owns the window, then you might want to look here[^] for considerations and methods to accomplish this.
RageInTheMachine9532
|
|
|
|
|
Yes, I suppose it is the process. The link you sent was good but I need if for vb.net
|
|
|
|
|
I haven't been able to come up with a VB.NET sample of the same thing, but there is no reason why the sample cade can't be converted into VB.NET using calls into the Win32 API.
RageInTheMachine9532
|
|
|
|
|
SELECT Sum(Amount) as "Total Expenditures", Month(eDate) as "Month"
FROM Expenditure
GROUP BY Month(eDate)
ORDER BY Month(eDate)
Above is my current SQL statement. I would like to change it so that it would generate a table that shows zeros for months that have zero "Total Expenditures". Currently it only shows amounts for months that have
total > 0. I think I could do it once I get it into my datatable but the query would be nicer.
Thanks
"It has become appallingly obvious that our technology has exceeded our humanity."
- Albert Einstein (1879-1955)
"I think there is a world market for maybe five computers."
- Thomas Watson (1874-1956), Chairman of IBM, 1943
"640K ought to be enough for anybody."
- Bill Gates (1955-), in 1981
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
How about a WHERE clause like 'WHERE Sum(things) = 0' at the end.
The warlord
|
|
|
|
|
That would only retrieve months with zero expenditures. I want both months with zeros and months with amounts > 0 in one table.
|
|
|
|
|
I am trying to use the GetFileOpen command and I have it working fine. I just want it to default to open to the same folder. c:/Assembly/ here is the code I have.
fileToOpen = Application _<br />
.GetOpenFilename("Assembly (*.exe), *.exe", , "Open Clave Drawings") How do I get it to always open the C:\Assembly folder?
Thanks,
Steve
|
|
|
|
|
I'm assuming this is code for an Office application...
The short version is you can't set that in the control directly. But, you might want to try launching the file that contains your worksheet or database from that folder first to see if that takes care of it.
The long version is you could write your own Open File dialog to get the exact functionality you want.
RageInTheMachine9532
|
|
|
|
|
I want to migrate a Application from ASP and VB6 to .NET
The main Part of the appication resides in a DLL written in VB accessing Request, Response and Session Object of the ASP-Page. It returns also a string back to the calling ASP-Page.
In a first step, I want to call the VB6.DLL from a .aspx Page.
Can I pass the scripting context in a similar way I did with asp?
Is it possible to write something like:
...
Dim IgPage As New IG4ASPA11.ASPPage
IGOutput = IgPage.OnStartPage(xxxxx)
IGOutput = IgPage.OnePage
....
What would I have to write instead of xxxxx?
Your help is very much appreciated
Beat
I add some relevant code from the old VB6 / ASP-Application
VB6-Code START -----------------
Class Module ASPPage
Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)
' is autmatically called
Set MyScriptingContext = PassedScriptingContext
...
End Sub
Sub OnePage()
' complex application accessing Session, Request, Response and Applicaiton Object
....
MyScriptingContext.Response.Write "Some Direct Response Text"
...
OnePage = MyOutput
End Sub
VB6-Code END -----------------
ASP-Code START------------------
Code from the calling ASP-Page
Set ig4asp = Server.CreateObject("IG4asp.ASPpage")
zResp = ig4asp.onepage
Response.write zResp
ASP-Code END------------------
Beat
|
|
|
|
|
Hello everybody!
I'm a beginner developer in .Net and I need to know if I can convert Bitmaps to Metafiles in anyway. ( The Save method of the Image Class does´nt work beetwen vectorial images and pixelized images ).
Advanced Thanks!
|
|
|
|
|
There is no indiginous class to the .NET Framework that will convert between vector and bitmap images. Your going to have to either search for a 3rd party control (I haven't been able to find one) or write one yourself. The main problems are going to be getting scaling right since vector images can be scaled to any size without loss of quality and bitmap images can't.
RageInTheMachine9532
|
|
|
|
|
Thanks for reply, I'm going to try it.
|
|
|
|
|
hello all, this is my first mesage here!
Well i'm have a litle problem... i'm trying to catch a key whit the
Overrides Sub OnKeyPress and the code that I'm write was this:
<br />
If e.KeyChar = Microsoft.VisualBasic.ChrW(?) Then<br />
<br />
abol_x = bol_x<br />
bol_x += 10<br />
mov_bola()<br />
e.Handled = True<br />
End If<br />
the first problem that i'm have is to now the char code to the cursors keys.. is a map whit that anywere?
the idea is to move a ball whit this and that is done whit the sub mov_bola, and only if i'm press the up cursor key i'm whant to execute this code
Others things the ball is disign in runtime using GDI+ and designed in a picturebox
any sugestion to help me on this is apreciated
Thanks
The Limit is your mind
|
|
|
|
|
Hi. I’ve never coded in VB but I want to do one small plug-in for MSProject. I want a tool button that (when pressing it) saves the current project in a file c:\temp.xml file (The XML format is important).
Is VB the “right way” to solve my problem? Open for suggestions.....
Thanks
APe
|
|
|
|
|
can someone pls tell me how do i make a particular word in a rtf blink??
i mean...
like when we do rtf.seltextbold then any text after that, will be bold
like when we do rtf.selcolor = vbred then any text after that will be red in color..
can someone pls tell me what do i do so that after doin that the rest of the text will be flashing???
tks a lot...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
Simple, rtf doesn't support blinking text.
But, displaying a web page in your form does...
RageInTheMachine9532
|
|
|
|
|
I would like make my own form so i set Control Box = False
and i use a label for Title Bar but i don't know how to drag and drop my form. I would appreciate if any one help me on this matter.
Many Thanks
|
|
|
|
|
I have a DropDownList where the ValueField is a guid as a string. I then need to pass this as a guid into a stored procedure. If I try and cast a string to a guid I get the following error: Value of type 'String' cannot be converted to 'System.Guid'. What do I need to do to get this to work?
Jim
|
|
|
|