Click here to Skip to main content
16,005,734 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: can commandbuilder generate incorrect sql statement? Pin
Dave Kreskowiak14-Jul-06 0:51
mveDave Kreskowiak14-Jul-06 0:51 
GeneralRe: can commandbuilder generate incorrect sql statement? Pin
Agus Budianto14-Jul-06 4:36
Agus Budianto14-Jul-06 4:36 
Questionexcel col width changin Pin
_tasleem13-Jul-06 16:47
_tasleem13-Jul-06 16:47 
QuestionListView in VB.Net Pin
khwo13-Jul-06 16:23
khwo13-Jul-06 16:23 
AnswerRe: ListView in VB.Net Pin
Kschuler14-Jul-06 8:58
Kschuler14-Jul-06 8:58 
Questionregarding tabcontrol Pin
rcshek13-Jul-06 15:27
rcshek13-Jul-06 15:27 
AnswerRe: regarding tabcontrol Pin
Dave Sexton13-Jul-06 21:24
Dave Sexton13-Jul-06 21:24 
QuestionSystem.NullReferenceException Pin
andrew_dk13-Jul-06 12:36
andrew_dk13-Jul-06 12:36 
Hi,
I have a VB.Net app that for various reasons is required to load a dll written in C using the LoadLibrary and (when done) FreeLibrary APIs. For the most part everything works perfectly. However there is a problem with one of the functions in the dll, which simply writes an empty file in the users temp directory. When called via the VB.Net app using the following code:

pFunction = GetProcAddress(hDllInstance, f)
If Not pFunction.Equals(System.IntPtr.Zero) Then
Try
CallWindowProc(pFunction, 0, 0, 0, 0)
Catch ex As Exception

End Try
End If

a System.NullReferenceException is always thrown. The file however is written correctly. The function in the dll is simply:

void CreateTempFile()
{
HWND hWnd = CreateFile(szFilePath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL);
CloseHandle(hWnd);
}

The szFilePath parameter is 1024 chars long (ie. no buffer overruns) and contains the name of the file to create. I created a test program in C to load and test the dll functions and this ran perfectly, both standalone and when run stepwise in a debugger. No exceptions or buffer overruns (etc.) occurred.

I am running the VB.Net app with administrator priviledges. Any ideas would be gratefully received.
Thanks
AnswerRe: System.NullReferenceException [modified] Pin
Dave Kreskowiak13-Jul-06 14:11
mveDave Kreskowiak13-Jul-06 14:11 
GeneralRe: System.NullReferenceException Pin
andrew_dk13-Jul-06 14:44
andrew_dk13-Jul-06 14:44 
GeneralRe: System.NullReferenceException Pin
Dave Kreskowiak13-Jul-06 15:31
mveDave Kreskowiak13-Jul-06 15:31 
GeneralRe: System.NullReferenceException Pin
andrew_dk16-Jul-06 16:28
andrew_dk16-Jul-06 16:28 
Questioncolor changing in .net Pin
_tasleem13-Jul-06 9:19
_tasleem13-Jul-06 9:19 
AnswerRe: color changing in .net Pin
Guffa13-Jul-06 12:21
Guffa13-Jul-06 12:21 
QuestionHow to split a wave file? Pin
sheikh7813-Jul-06 9:17
sheikh7813-Jul-06 9:17 
AnswerRe: How to split a wave file? Pin
Guffa13-Jul-06 12:30
Guffa13-Jul-06 12:30 
QuestionPopulating a comboBox with an ArrayList Pin
newbjohny13-Jul-06 8:31
newbjohny13-Jul-06 8:31 
AnswerRe: Populating a comboBox with an ArrayList Pin
Dave Kreskowiak13-Jul-06 10:32
mveDave Kreskowiak13-Jul-06 10:32 
GeneralRe: Populating a comboBox with an ArrayList Pin
newbjohny13-Jul-06 11:56
newbjohny13-Jul-06 11:56 
QuestionSQL SERVER Monitor Pin
MalikRizwan13-Jul-06 8:14
MalikRizwan13-Jul-06 8:14 
AnswerRe: SQL SERVER Monitor Pin
Duncan Edwards Jones13-Jul-06 22:03
professionalDuncan Edwards Jones13-Jul-06 22:03 
QuestionProblem Connecting Crystal Report with VB6 Pin
PapPatel13-Jul-06 8:11
PapPatel13-Jul-06 8:11 
QuestionOne to many columns in a report Pin
Gulfraz Khan13-Jul-06 6:58
Gulfraz Khan13-Jul-06 6:58 
QuestionConvert ASCII code points to UNICODE Pin
jimithing7713-Jul-06 4:52
jimithing7713-Jul-06 4:52 
AnswerRe: Convert ASCII code points to UNICODE Pin
Christian Graus13-Jul-06 5:16
protectorChristian Graus13-Jul-06 5:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.