Article View: borland.public.cppbuilder.nativeapi
Article #8728Re: Access Violation on LoadLibrary
From: Vladimir Afanasyev
Date: Tue, 21 Sep 2004 16:08
Date: Tue, 21 Sep 2004 16:08
31 lines
1704 bytes
1704 bytes
Hi,
>
>I'm dealing with a DLL and i'm getting Access Violation Errors continously.What is wrong with my code?
>
>Analyzer
>
>//---------------------------------------------------------------------------
>
>#include <vcl.h>
>#pragma hdrstop
>
>#include "main.h"
>#include "hllapi.h"
>//---------------------------------------------------------------------------
>#pragma package(smart_init)
>#pragma resource "*.dfm"
>TForm1 *Form1;
>
>typedef WORD WINAPI(*THllapiEntry) (int *, char *, int *, int *);
>
>HWND DllHandle = LoadLibrary("PCSHLL32");
>
>THllapiEntry EntryPoint = (THllapiEntry)GetProcAddress( DllHandle, "HLLAPI" );
>
In bad case LoadLibrary can return NULL and next call will
not work properly. So first try to verify results of LoadLibrary
and GetProcAddress in your code.
Vladimir.
Technical Details
Message-ID:
<415051e8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<414fceb0$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,96780444f192a93f X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Afanasyev" <avv@systema.kiev.ua> Sender: "Vladimir Afanasyev" <avv@systema.kiev.ua> Reply-To: "Vladimir Afanasyev" <avv@systema.kiev.ua> Subject: Re: Access Violation on LoadLibrary Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 83.218.237.46 X-Forwarded-For: unknown References: <414fceb0$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <415051e8$1@newsgroups.borland.com> Date: 21 Sep 2004 09:08:08 -0700 X-Trace: newsgroups.borland.com 1095782888 207.105.83.66 (21 Sep 2004 09:08:08 -0700) Lines: 31 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail