|
Thanks for your advice, led mike! For the link you provided, which one(s) are dealing with authentication? I checked a few, but not dedicated for authentication purpose. Any comments?
regards,
George
|
|
|
|
|
George_George wrote: For the link you provided, which one(s) are dealing with authentication? I checked a few, but not dedicated for authentication purpose.
I don't that any are dedicated to authentication. You seem to need an overall better understanding of the Platform you are trying to interface with.
led mike
|
|
|
|
|
Thanks all the same led mike!
regards,
George
|
|
|
|
|
Iam Developed one application(With some Data Base) in VC++ 6.0 environment.
The Exe(in Release mode)is working fine in VC++, .NET systems either
the system OS is XP or 2000.
But i was Stucked at some systems that are not had VC++ and .NET.
here iam not able open Database connection.
iam not able to get the bug.is it any DLL problem?
|
|
|
|
|
There is missing some stuff for the database access as drivers or dll. You got to find where the errors happen. For that it is essential to make error handling in your app: writing a log or giving out messageboxes on errors.
Greetings from Germany
|
|
|
|
|
Mr.KarstenK,
Thank you.
I have to Access Some database window after clicking some button in GUI.
its working properly in VC and .NET based systems.
iam facing some problem in non VC and .NET based systems.Here iam not able to access the database window after clicking the button where as in VC n .Net systems...its working fine
|
|
|
|
|
krishna Vuppala wrote: But i was Stucked at some systems that are not had VC++ and .NET.
Is part of your application written for .NET?
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
no its written for VC++.
but i tested the EXE(in release mode) file in Various systems in my office.
|
|
|
|
|
Hi all
I met a confusing issue, just as the title says.
There's a network printer installed in my machine. And in my code when I open this printer with "OpenPrinter" API, it will failed. But, in fact the printer is OK, because I can use it to print in Notepad.
My code is:
HANDLE hPrinter = NULL;
PRINTER_DEFAULTS PDef;
PDef.pDatatype = NULL;
PDef.pDevMode = NULL;
BOOL bRet = OpenPrinter(_T("\\\\172.xx.xxx.xx\\HP LaserJet 1020"), &hPrinter, &PDef);
What confuses me most is that, the "OpenPrinter" API doesn't faill in all test machines. Only in some machines it fails. In most test machines, it is OK to open the printer.
I checked the printer and the test machines, however nothing wrong was found.
And what's more, when OpenPrinter fails, the error code is 5, which means "Access is denied". It seems that the test machines can't access the printer. But it does printing operation OK!
What's the problem with my machine?
Any response will be appreciated very much!
|
|
|
|
|
Unfortunately their are 2 OpenPrinter APIs, one in Winspool.lib and one in SpoolSS.dll. If you use the wrong one then horrible, and not easily predictable, things occur. I suggest you check this out first, determine which one you're calling, try the other one and if things are no better or worse then feel free to vote this a bad answer.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Matthew Faithfull wrote: Unfortunately their are 2 OpenPrinter APIs, one in Winspool.lib and one in SpoolSS.dll. If you use the wrong one then horrible, and not easily predictable, things occur. I suggest you check this out first, determine which one you're calling, try the other one and if things are no better or worse then feel free to vote this a bad answer.
Matthew Faithfull, thank you very much.
I will check it.
|
|
|
|
|
|
Amin, thank you very much!
Actually, I have tested to set the "pDesiredAccess" to "PRINTER_ACCESS_USE", instead of using "PRINTER_ALL_ACCESS". When I doing this, "OpenPrinter" to all printers installed in my machine is successful. However, in fact, there's another network printer which is unaccessible. When I use "PRINTER_ALL_ACCESS" in "OpenPrinter", it can't distinguish this situation.
What I mean is that, in my machine there're two network printers. One is OK and another is really unaccessible. When I use "PRINTER_ALL_ACCESS", "OpenPrinter" to both of the two printers is FAILED. On the contray, use "PRINTER_ACCESS_USE", makes "OpenPrinter" to the two printers successful.
I thought that there should to be a method for "OpenPrinter" to distinguish these two printer accurately. But my test shows that "OpenPrinter" is somewhat awkward.
Maybe there's something wrong with the setting of my computer.
|
|
|
|
|
I am not pretty sure why this happens with the other printer but
you can test by runing your application form some other PC and
check if you can acess both the n/w printers.
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
Hi,
Then i use
STANDARD_RIGHTS_REQUIRED | PRINTER_ACCESS_USE | PRINTER_ACCESS_ADMINISTER everything perfect for network printers.
http://selcukgural.com
|
|
|
|
|
Hi EveryOne,
I am doing one VC++ Program in that i want to insert VB Dll.
i am importing dll in stdafx.h file like this #import "C:\Program Files\Microsoft Visual Studio\My Projects\BoolDate\SampleDll.dll"
In VB Dll i am having one function called ProcessingInformation with 5 string type variables and return type is boolean.
After this i am adding one button in that button function i want access processinformation function but when i am accessing then it is giving error like processinformation is undefined declaration.
Please tell me how to use dll functions in my program i tried but i am getting solution.i used one way which i got from codeproject only but in that midl not found error is coming in command prompt.
Please give me some suggestions...HELP ME OUT...
Thanks in ADVANCE,
Savitri
|
|
|
|
|
For using dll on the c++ you need to use of LoadLibrary and then use of GetProcAddress.
|
|
|
|
|
That's explicit DLL loading. You should mention also the implicit one.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I think he wants to load dlls on the c++.
|
|
|
|
|
Hamid. wrote: I think he wants to load dlls on the c++
That's true.
Anyway, you know, there are two ways to do it (and implicit DLL load is the load-time linking with the DLL ).
[added]
Well, maybe I got you: for a VB DLL you haven't neither the .lib nor the the .h file needed to
compiler your project for implicit loading (and I don't remember if #import directive may help).
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Friday, August 22, 2008 6:40 AM
|
|
|
|
|
Except this, use of windows api's on other languages is difficult c++.
|
|
|
|
|
savitri wrote: I am doing one VC++ Program in that i want to insert VB Dll
The first good question maybe: why do I need such a thing?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hii
Thanks for replying..I am having one DLL in VB for my project Concern.
But i dont how to import DLL's in VC++.When i am doing like that what i mentioned in last message it is not possible to get functions from dll.
So please will you tell me how can i get the functions from the VB dll to vc program.
Please help me out I am trying from two days but i am not getting solution please tell me..I am using loadlibrary and getprocaddress like this:
typedef BOOL (WINAPI* ptr_func1)(BSTR* bstr,BSTR* bstr1,BSTR* bstr2,BSTR* bstr3,BSTR* bstr4);
ptr_func1 ProcessingInformation = NULL;
HINSTANCE hLib;
hLib = LoadLibrary(_T("C:\\Program Files\\Microsoft Visual Studio\\My Projects\\BoolDate\\SampleDll.dll"));
if (hLib == NULL)
{
MessageBox(_T("Unable to load .dll"), NULL, MB_ICONERROR);
}
else
{
ProcessingInformation = (ptr_func1)GetProcAddress(hLib,
_T("ProcessingInformation"));
CString str;
BSTR server,usr,pwd,Temp,Temp3;
BOOL bstr;
Temp=SysAllocString(L"21\8\2008");
str=Temp;
MessageBox(str);
Temp3=SysAllocString(L"21\7\2008");
str=Temp3;
MessageBox(str);
server=SysAllocString(L"savitri");
str=server;
MessageBox(str);
usr=SysAllocString(L"root");
str=usr;
MessageBox(str);
pwd=SysAllocString(L"base");
str=pwd;
MessageBox(str);
/* The actual call to the function contained in the dll */
bstr = ProcessingInformation(&Temp,&Temp3,&server,&usr,&pwd);
MessageBox("Gettting BSTR Value");
str.Format("%d",bstr);
MessageBox(str);
SysFreeString(Temp);
SysFreeString(Temp3);
SysFreeString(server);
SysFreeString(usr);
SysFreeString(pwd);
/* Release the Dll */
FreeLibrary(hLib);
}
Please tell me what is wrong with this code.Now i am not getting any errors in compiling time but in run time i am one error message box like send error and don't send..
Please Help me.I need your help very much.
Thanks In Advance,
Savitri
|
|
|
|
|
Does the DLL load successfully?
Also did you check that functions that you are calling are exported from the DLL
BTW on which line do you encounter the crash
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hii
Ya it is loading dll properly because it is not giving error..i am checking conditions also.I send that part of code in last message please tell me what is wrong with my code.I am getting tension.
Please give me some suggetions.please help me out.
Thanks IN ADVANCE,
Savitri
|
|
|
|