LoadLibrary Error

Hi All,
I'm trying use LoadLibrary, but always fail, and I get error 998 
(GetLastError();)

How I fix this.
HINSTANCE module = 
LoadLibrary("E:\\project-ucs\\_project\\system\\soa\\source-ucsms\\out-project\\debug\\wiz-addter.dll");

if(module == NULL)

{

// error

//

GetLastError();

MessageBox(err.c_str());

}



Thanks



0
re.tf1 (4)
4/6/2006 2:41:54 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
686 Views

Similar Articles

[PageSpeed] 30

Which equates to "Invalid access to memory location."  Does the call
fail with other DLLs too, or just wiz-addter.dll?

Retf wrote:
> Hi All,
> I'm trying use LoadLibrary, but always fail, and I get error 998
> (GetLastError();)
>
> How I fix this.
> HINSTANCE module =
> LoadLibrary("E:\\project-ucs\\_project\\system\\soa\\source-ucsms\\out-project\\debug\\wiz-addter.dll");

0
4/6/2006 5:25:33 PM
for 2 dll that link to 'AddTerminal_types15d.lib', the dll that no link to 
'AddTerminal_types15d.lib', work fine.

thanks
"DavidCrow" <david.crow@pbsnow.com> escreveu na mensagem 
news:1144344333.257855.7030@e56g2000cwe.googlegroups.com...
> Which equates to "Invalid access to memory location."  Does the call
> fail with other DLLs too, or just wiz-addter.dll?
>
> Retf wrote:
>> Hi All,
>> I'm trying use LoadLibrary, but always fail, and I get error 998
>> (GetLastError();)
>>
>> How I fix this.
>> HINSTANCE module =
>> LoadLibrary("E:\\project-ucs\\_project\\system\\soa\\source-ucsms\\out-project\\debug\\wiz-addter.dll");
> 


0
re.tf1 (4)
4/6/2006 6:13:22 PM
Do you do anything in your DllMain(...)?

-- 
Vipin Aravind
http://www.explorewindows.com


"Retf" <re.tf@terra.com.br> wrote in message 
news:OAEZYsYWGHA.1200@TK2MSFTNGP03.phx.gbl...
> Hi All,
> I'm trying use LoadLibrary, but always fail, and I get error 998 
> (GetLastError();)
>
> How I fix this.
> HINSTANCE module = 
> LoadLibrary("E:\\project-ucs\\_project\\system\\soa\\source-ucsms\\out-project\\debug\\wiz-addter.dll");
>
> if(module == NULL)
>
> {
>
> // error
>
> //
>
> GetLastError();
>
> MessageBox(err.c_str());
>
> }
>
>
>
> Thanks
>
>
> 


0
vipin (697)
4/6/2006 6:18:32 PM
- Is the path to DLL correct?
- Use Depends.exe to load that DLL and make sure you see that all
dependencies of this module are available.

---
Ajay

0
ajaykalra (6841)
4/6/2006 6:21:48 PM
Hi, yes, see:

I replace this:
/*

static AFX_EXTENSION_MODULE dlgconntsDLL = { NULL, NULL };

extern "C" int APIENTRY

DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)

{

// Remove this if you use lpReserved

UNREFERENCED_PARAMETER(lpReserved);

if (dwReason == DLL_PROCESS_ATTACH)

{

TRACE0("dlgconnts.DLL Initializing!\n");


// Extension DLL one-time initialization

if (!AfxInitExtensionModule(dlgconntsDLL, hInstance))

return 0;

// Insert this DLL into the resource chain

// NOTE: If this Extension DLL is being implicitly linked to by

// an MFC Regular DLL (such as an ActiveX Control)

// instead of an MFC application, then you will want to

// remove this line from DllMain and put it in a separate

// function exported from this Extension DLL. The Regular DLL

// that uses this Extension DLL should then explicitly call that

// function to initialize this Extension DLL. Otherwise,

// the CDynLinkLibrary object will not be attached to the

// Regular DLL's resource chain, and serious problems will

// result.

new CDynLinkLibrary(dlgconntsDLL);

}

else if (dwReason == DLL_PROCESS_DETACH)

{

TRACE0("dlgconnts.DLL Terminating!\n");

// Terminate the library before destructors are called

AfxTermExtensionModule(dlgconntsDLL);

}

return 1; // ok

}

//#include "resource.h"

*/

to this:



#include "DlgConnectToServer.h"



extern "C" AFX_EXT_CLASS int ShowDialog(CWnd *pWndParent);

AFX_EXT_CLASS int ShowDialog(CWnd *pWndParent)

{

AFX_MANAGE_STATE(AfxGetStaticModuleState());

CDlgConnectToServer dlg(pWndParent);

return (int)dlg.DoModal();

}







"Vipin [MVP]" <Vipin@nospam.com> escreveu na mensagem 
news:uKpxEaaWGHA.4768@TK2MSFTNGP05.phx.gbl...
> Do you do anything in your DllMain(...)?
>
> -- 
> Vipin Aravind
> http://www.explorewindows.com
>
>
> "Retf" <re.tf@terra.com.br> wrote in message 
> news:OAEZYsYWGHA.1200@TK2MSFTNGP03.phx.gbl...
>> Hi All,
>> I'm trying use LoadLibrary, but always fail, and I get error 998 
>> (GetLastError();)
>>
>> How I fix this.
>> HINSTANCE module = 
>> LoadLibrary("E:\\project-ucs\\_project\\system\\soa\\source-ucsms\\out-project\\debug\\wiz-addter.dll");
>>
>> if(module == NULL)
>>
>> {
>>
>> // error
>>
>> //
>>
>> GetLastError();
>>
>> MessageBox(err.c_str());
>>
>> }
>>
>>
>>
>> Thanks
>>
>>
>>
>
> 


0
re.tf1 (4)
4/6/2006 7:06:22 PM
yes,

thanks to help....

"Ajay Kalra" <ajaykalra@yahoo.com> escreveu na mensagem 
news:1144347708.299685.58920@v46g2000cwv.googlegroups.com...
>- Is the path to DLL correct?
> - Use Depends.exe to load that DLL and make sure you see that all
> dependencies of this module are available.
>
> ---
> Ajay
> 


0
re.tf1 (4)
4/6/2006 7:07:00 PM
I dont see anything out of the ordinary here. Use Depends.exe and see
the results. That should always be the first tool to go to in cases
like this.

---
Ajay

0
ajaykalra (6841)
4/6/2006 7:18:26 PM
Reply:

Similar Artilces:

Fatal Error during install
I get through the CRM Server install, but at the last moment while the system is wrapping up, the following error occurs: ----- "Fatal Error" Installation ended prematurely because of an error. ----- Three databases are created and the web files are copied to the root. Any thoughts on why the installation doesn't complete? Thanks. --Ed Fatal Error during install - More info: The CRM server is on a different box than the SQL server. CRM: Windows 2000, SP3 SQL: Windows 2000, SP3, SQL 2000 Standard, SP3 I have read that there may be an issue with SQL Server SP3, but...

XML Parse Error Codes
Is there any place I could find a list with all the parsing errors you can get when loading an XML document? I'm mostly interested in error codes generated when using a schema to validate an instance document. All I could find on the web was related to PHP parser implementation, but I'd like to have such a reference specific to MSXML 4.0 SP2 if that's possible. ...

Intermittent error
I have an odd one. My client has a P IV with 512 RAM, SP Pro, Office 2003 all updates etc. He checks two email addresses. I use the ISP’s smtp server on both and both email accounts check with a send receive. I have disabled the “send” function on one account since it is unnecessary. Every few “Send/Receive”’s, he gets “Receiving reported error (0x800CCC0F): The connection to the server was interrupted.’ My server settings must be right as he does send and receive email. As soon as I get the error, it goes away and does a successful send/receive before I can try to ping the server...

IMAP4SVC errors
We're getting ready to deploy a new E2k3 SP1 cluster and have begun to move some test users over to it. Some of our IMAP users are receiving an error: Event ID 1023: Error 0x8004050a occurred while rendering message 0011-000000c9660e for download for user xyzzy@[EMAIL PROTECTED] Any ideas? We're running a similar setup and have the same problem. It means that there are some messages that cannot be retrieved via IMAP. We opened an incident with Microsoft and the feel that it is the anti-virus software we are running. Sure enough, turning off the AV makes the error go away. ...

Mystery error
Has anyone ever received and explanation for the floowing error? Event Type: Error Event Source: MSExchangeTransport Event Category: NDR Event ID: 3015 Date: 10/13/2005 Time: 1:48:37 PM User: N/A Computer: myserver Description: A non-delivery report with a status code of 5.3.0 was generated for recipient rfc822;someguy@somedomain.net (Message-ID <1773136B08AB5742BF2B8C10FD547DE406DC68B3@myserver.mydomain.com>). Causes: Exchange mistakenly attempted mail delivery to an incorrect MTA route. For more information, click http://www.microsoft.com/contentredirect.asp. Solution:...

confusing error in access2003 db running in access2007
have opened a 2003 db in 2007...opens fine, but when adding records I am getting an error as follows: Microsoft Office Access -2147352567 Method ‘Nz’ of object ‘_Application’ Failed I can perform the exact same actions on the dB in 2003, and do not have a problem...I am wondering if the NZ method in conjuction with data on an sql server is invalid...I feel as if this particular dB is getting corrupted when being used in Access 2007...I have been unable to convert this dB to 2007....the error message is that the dB is already opened exclusively by another user...which is me...the dB si...

Rules in error... error
I can't seem to get my rules to work properly. I've set it up so two things happen: 1. All mail coming from a specific account gets moved to a folder the error I get is "cannot remove items from folder" then rule gets turned off. 2. Junk mail not sent to me with specific words on the subject line: error: "you don't have authorization" then the rule gets turned off. In all instances, if I run the rule separately (manually) they work. Can someone tell me what's wrong and how to correct it? Thanks ...

DSAMAIN.exe error
Hi, We have exchange 5.5 Server. From last day it start giving DSAMAIN.exe error & Directory services get stooped. We have also rebuild the new server with older Backup but it also giving the same DSAMAIN.exe error & Directory services get stoped. Pl. help us to resolved this issue. -- Regards, Ahmad M. Zahoory E-mail: ahmad.zahoory@gmail.com Hi, Please post the events logged in the application log when the directory service stops or look for the events at www.eventid.net Leif "Ahmad M. Zahoory" <Ahmad@community.nospam> wrote in message news:E71D6CE2-9DF5-...

LoadLibrary
hi, I have a rather peculiar situation. I am writing a application that determines which DLL needs to be loaded at run-time. I use LoadLibrary Win32 API to load the needed DLL at runtime. LoadLibrary fails to load the dll even though the DLL is present in the location. GetLastError returned me '126' : The sepcified module could not be found. I am loading an MFC Application Extension DLL through a COM. The COM is invoked through a ASP. That means the DLL is to be loaded in the InetInfo.exe. LoadLibrary does not fail for dlls other than Application Extension DLLS. Please can anyone help...

Globalevents error
On our domain controllers, we're receiving a slew of NTDS SDPROP with an event ID of 2008. When we trace through the source object contained in the description of the error, they point to public folders residing on one of our servers. In one case, it points to the globalevents public folder. The one anomoly observed in this public folder is the approximately 1600 smtp addresses ascribed to this folder. It takes on addresses in the form: 1035de@domain.com We don't appear to be adversely affected but the red errors are everywhere. Any ideas? rambogjohn@netscape.net (John) wrote: ...

Errors 9095 and 9096 every 30 seconds.
Hello, I have an new OWA server that I am setting up. I set it up inside the network and everything worked. I opened the appropriate ports and placed the OWA server in the DMZ and dismounted the private and public information store. Now I get errors 9095 and 9096 (MAD Monitoring thread initializning (initialized)) in the event log every 30 seconds. I have not found anything to explain this. The articles that I did find say that this might happen and it is nothing to worry about. But I would like to find a way to stop it. Has anyone seen this and have a solution to it. TIA Greg...

Delivery Error
Any idea what the error message "Delivery of the message required a bilateral agreement where no such agreement exists..." Richard <anonymous@discussions.microsoft.com> wrote: > Any idea what the error message "Delivery of the message > required a bilateral agreement where no such agreement > exists..." That's a X.400 error. From what I can see with Google, X.400 protocols state that messages cannot be exchanged unless you and the other party have agreed to that exchange and your mail transports have been configured properly. At least, that's ...

Macros Error:
I got error message: The macros in this project are disabled. Please refer to the online help or documentation of the host application to determined how to enable macros. (microsoft visual basic) (microsoft outlook 2003). I need your help with this command then tell me to do. Thank you for helping, david Tools | Macro | Security Restart Outlook after you change the setting.=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Pow...

why the build error?
I got the build error said: "c:\Temp\coefCalculator.h(10): error C2011: 'CoefCalculator' : 'class' type redefinition". I checked the code. Only one place defined the class. Why I got this message? Is your header file wrapped inside a #ifndef like this:- #ifndef COEFCALCULATOR_H #define COEFCALCULATOR_H class CoefCalculator { ..... } #endif -- Vipin Aravind http://www.explorewindows.com "kathy" <yqin_99@yahoo.com> wrote in message news:1142105022.232791.227650@v46g2000cwv.googlegroups.com... >I got the build error said: > > "c:\...

run-time error 35752
I trying to play AVI on form but this error keep appearing "run-time error 35752". ...

Capturing First Error Message
Hi All, For the following code, I am getting two difference errors. I need to capture the first error message. Please advise how to capture the first error message. I need to log this info in Error_Log table. CODE ===== drop table authors go CREATE TABLE Authors ( AuthorID INT NOT NULL PRIMARY KEY, Name VARCHAR(100) NOT NULL ) GO ALTER TABLE Authors ADD CONSTRAINT pk_authors PRIMARY KEY (AuthorID) GO print @@error ================ Thanks in Advance, Guru Hi Can you use BEGIN ..TRY ..BEGIN CATCH ... to capture the errors? "Guru" <guruprasathb@...

Sales Process Error
I am having problems with sales process on sending emails and tasks. The sales process errors out with the following message - Error code = 80131509. This SqlTransaction has completed; it is no longer usable. I haven't made any changes to the system and it was working fine two days ago. The Event ID in Windows is 16650. We are on SQL 2005 and Windows Server 2003 R2 SP1. Any help would be appreciated. It is a .Net Framework 2.0 issue with SQL Server 2005. Do not be mislead that MSCRM 3.0 is using 1.1. I have had this recently on a couple environments that I support. Check out: - ...

code error
Please can anyone help - my PC runs out of memory (I currently have 512) I'm presuming that my code is badly written - can anyone please help with this, code follows: Private Sub CommandButton1_Click() ' Option box allowing user to select relevant ctr filetoopen = Application _ .GetOpenFilename("Excel Files (*.xls), *.xls") If filetoopen <> False Then Workbooks.Open Filename:= _ filetoopen End If Dim strPath As String, strFileName As String strPath = ActiveWorkbook.FullName strFileName = Mid(strPath, InS...

Not Enough Memory Error
Recently we've started to experience an error when we attempt to open a Contact (E-mail List) within a mailbox. We are getting the following error: "Can't open this item. There is not enough memory available on the Microsoft Exchange Server computer to perform this operation." Memory usage in the task manager on the machine is around 1.4GB, the machine has 2GB of physical memory and is showing 500MB free. Any assistance would be appreciated! Thanks! Honestly, that sounds more like a client error than an Exchange error. Are there any corresponding errors in the eve...

Error Creating New email addresses
This is a multi-part message in MIME format. ------=_NextPart_000_000C_01C4602D.1003B610 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Greetings: We have a 2k3 SBS running Exchange with the latest service pack. We = have several email addresses that messages sent to are distributed to = numerous people so the email addresses have been configured as part of a = distribution group. A week or so ago, I noticed that the email = addresses were no longer in the "Email Addresses" tab in the = distribution group. I added the a...

printing error handling issue? (when clicking cancel get 2501 error)
I have a report that when it is closed the DoCmd RunCommand acCmdPrint occurs ... but of course if the user clicks cancel, it gives me a 2501 error. How & where do I put code to surpress this error. I would just the close even to run the DoCmd RunCommand acCmdPrint and if cancel is selected just continue to close the report? TIA, _Bigred I understand that I have to do this, I actually don't understand HOW to do it, and where to put code to accomplish this?? 1) What code do I use? 2) Where do I put the code? Thanks, _Bigred "Duane Hookom" <duanehookom@NO_...

Runtime error '1004' General ODBC error
I'm getting this error when i run a Excel macro which connects to oracle and reads data from a table Runtime error '1004' General ODBC error this marco used to work fine, until i installed a Win 2000 patch. i'm using oracle version 8.1.6 i chked the path and classpath they look good and im able to connect to the same oracle instance using the Oracle ODBC Test and able to run queries. i use microsoft Excel 2000. -- star_lucas ------------------------------------------------------------------------ star_lucas's Profile: http://www.excelforum.com/member.php?action=g...

SSL error public folders
Hi all I am running Exchagne 2003 on windows 2003. I have configured my own certificate and i can get to OWA using https without issues, however when i open up ESM and drill down to the public folders icon i get an error that says" the SSL certificate servername is incorrect" I have found an article over at http://www.winntmag.com/forums/messageview.cfm?catid=40&threadid=119267 and i have follwed it but im still getting this error, and i cant see the public fodlers in ESM, but i can see them in OWA, and outlook Thanks very much for any help. So you cleared the Require SSL chec...

Microsoft Outlook 2000
Help? I recently had a computer aquire a virus/spyware called PowerScan 1.1. I think I got rid of all of it. Now my Outlook 2000 will not open up. Tried detect/repair, reinstalled twice and no luck. When clicking to open, it hangs for a couple of minutes and then a kernel32 error pops up and says to restart to resolve. No Luck. Any Ideas?????? ...

LoadLibrary Explorer
My latest toy is now available for download: The LoadLibrary Explorer. This allows you to run through various scenarios for LoadLibrary. Interestingly, I have found what appear to be three errors in the documentation (or in the implementation of ::LoadLibrary). I'm disappearing for a couple weeks, so let me know if you discover any problems, and I'll address them in about a month. joe www.flounder.com/loadlibrary_explorer.htm Joseph M. Newcomer [MVP] email: newcomer@flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm -- NewsGuy.Com 30Gb $9...