|
i m working in VC++6 and my OS is Windows 2000 SERVER
|
|
|
|
|
sunit5 wrote:
#include <wincrypt.h> // not needed since it is included by wintrust.h
#include <wintrust.h>
#include <Schnlsp.h>
Are you including windows.h before these? Have you installed the Feb 2003 Platform SDK, and adjusted the search paths to look in it first for include and library files?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-- modified at 10:11 Friday 9th September, 2005
|
|
|
|
|
Thanx a Lot Mr David Crow.thanx once again
|
|
|
|
|
So is the problem fixed? What was the solution?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanx for ur suggestion as i was baffled by this problem.i have to arrange CD for February 2003 SDK.As soon as i get and install it,I will notify you that whether the problem has been fixed.
|
|
|
|
|
Thanx for ur Sugeestion.
Yes the problem is fixed.The Solution was to Update the SDK using FEB 2003 Platform SDK.
I installed Core SDK (from Patform SDK) for updating wincrypt.h and wintrust.h .
And for Schnlsp.h(or one can include Schannel.h as Schnlsp.h includes Schannel.h)i installed Internet Development SDK from
Platform SDK
|
|
|
|
|
I am writing an NT Service which uses ADO to connect to an Oracle Database. I use the following statement to create an ADODB.Connection object.
_ConnectionPtr m_Conn = NULL;
m_Conn.CreateInstance(__uuidof(Connection));
The Create Instance statement fails to create a new Connection object and the m_Conn object is NULL even after the statement is executed.
However, when i try to run the application as a normal Windows Application it works fine.
I get the above problem only when running the application as a Windows Service. Can someone please help me?
Thanks in advance.
|
|
|
|
|
to asses problem just some checks,
use try catch,i.e.
catch _com_error and see what its decription says.
I strongly feels it is some thing related to security, access rights
|
|
|
|
|
Yes, you might end up discovering your service needs to be configured to run as a particular user - a user with some privileges on your local machine or on your domain - so that the service will have network rights or access to certain files. Just because some process runs as a service does not necessarily imply it has free reign of your machine or the LAN.
|
|
|
|
|
Adding a try catch block does not provide any assistance since no exception is thrown when i try to create a Connection object. The following is an extract of my code.
try
{
HRESULT hRes = m_Conn.CreateInstance(__uuidof(Connection));
if (m_Conn)
{
m_Conn->ConnectionString = strConn;
}
else
{
m_sErrorMsg = "Cannot create connection";
return FALSE;
}
}
catch( _com_error &e)
{
// get info from _com_error
m_sErrorMsg.Empty();
m_sErrorMsg.Format("%s : %s", (char *)e.Source(), (char *)e.Description ());
return FALSE;
}
Currently the service runs using the 'Local System' account. I have tried changing it to my user account, but it still doesn't work. The Connection object is null.
Any help is greatly appreciated.
Thanks.
|
|
|
|
|
chamilkab wrote:
Any help is greatly appreciated.
Perhaps you do it else where, but have you made the call to CoInitialize(NULL)?
Also, what is your HRESULT returning?
-------------------------------
DEBUGGING : Removing the needles from the haystack.
-- modified at 7:37 Monday 12th September, 2005
|
|
|
|
|
Hi!
I called ::CoInitialize before trying to create the connection. But still it didn't work when i ran the application as a service. However it works fine when running as a normal application.
However i found out later that since this is a Service Application you have to call ::Coinitialize from the ServiceMain Function.
Thanks for the help
|
|
|
|
|
chamilkab wrote:
However i found out later that since this is a Service Application you have to call ::Coinitialize from the ServiceMain Function.
Glad to hear you finally got it working. Good knowledge to know, I will have to remember that.
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
Can somebody help me in developing a software for a different language, other than English under WinXP English. Such that, buttons of messageboxes should have caption and text in that language. Any help wud be appreciated.
Best Regards,
|
|
|
|
|
Write some string resources in what ever language you want,
then use them to set the caption (window text) of your controls
SkyWalker
|
|
|
|
|
|
How to create wizard based programs in vc++
Plz Give simple code to understand.
In my system there is no Property Sheet Active X Control.
Praveen Chowdam Kumar
|
|
|
|
|
|
Hello!
This will sound like a simple problem, but unfortunately I wasn't able to do it up to now: just resize a window at runtime.
I have a dialog with a few controls. I now want to reposition one control 10 pixels to the left and make it 10 pixels bigger (i.e. just extend it to the left).
How do I do this?
I tried all combinations of GetWindowRect, ScreenToClient, ClientToScreen, SetWindowPos and MoveWindow that come to my mind, but the control is always positioned incorrectly. Help!!
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Let's say, your control is a CEdit (but it can be whatever )
<br />
CRect R;<br />
CEdit *pE = (CEdit *)GetDlgItem(IDC_EDIT_1);<br />
pE->GetWindowRect(&R);<br />
ScreenToClient(&R);<br />
R.left += 10;<br />
R.right += 10;<br />
R.top += 10;<br />
R.bottom += 10;<br />
pE->MoveWindow(&R);<br />
This will move the control 10 pixels to the right and downwards.
SkyWalker
|
|
|
|
|
Ah, this works, many thanks!!
The problem with my attempts was that I called the ScreenToClient function of the window to be moved (pE->ScreenToClient ) instead of the parent dialog's.
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
|
Those things happen most of the time to me, too
SkyWalker
|
|
|
|
|
I am programing a Socket with SSL,so i m using various header files for encrytion,ssl protocol
#include <wincrypt.h>
#include <wintrust.h>
#include <Schnlsp.h>
(these header files r in stdafx.h)
when i compiling my program is showing errors,eg
c:\program files\microsoft visual studio\vc98\include\schnlsp.h(118) : error C2501: 'ALG_ID' : missing storage-class or type specifiers
when click on the error
typedef struct _SecPkgCred_SupportedAlgs
{
DWORD cSupportedAlgs;
ALG_ID *palgSupportedAlgs;
} SecPkgCred_SupportedAlgs, *PSecPkgCred_SupportedAlgs;
when i check this strucure in msdn i found data type ALG_ID is defined in the Wincrypt.h header file.
when i check wincrypt i found that a macro has to be define
#if(_WIN32_WINNT >= 0x0400)for using wincrypt.h
so i defined #define _WIN32_WINNT 0x0500 in stdafx.h before any header file is defined
now when i again compile the program
D:\sunit\controleon\Working\CSocket\sslsocket.cpp(611) : error C2039: 'dwFlags' : is not a member of '_SCHANNEL_CRED'
c:\program files\microsoft visual studio\vc98\include\schnlsp.h(129) : see declaration of '_SCHANNEL_CRED'
i found the struct _SCHANNEL_CRED in schnlsp.h file
typedef struct _SCHANNEL_CRED
{
DWORD dwVersion;
DWORD cCreds;
PCCERT_CONTEXT *paCred;
HCERTSTORE hRootStore;
DWORD cMappers;
struct _HMAPPER **aphMappers;
DWORD cSupportedAlgs;
ALG_ID *palgSupportedAlgs;
DWORD grbitEnabledProtocols;
DWORD dwMinimumCipherStrength;
DWORD dwMaximumCipherStrength;
DWORD dwSessionLifespan;
} SCHANNEL_CRED, *PSCHANNEL_CRED;
where as in msdn
typedef struct _SCHANNEL_CRED
{
DWORD dwVersion;
DWORD cCreds;
PCCERT_CONTEXT * paCred;
HCERTSTORE hRootStore;
DWORD cMappers;
struct _HMAPPER ** aphMappers;
DWORD cSupportedAlgs;
ALG_ID * palgSupportedAlgs;
DWORD grbitEnabledProtocols;
DWORD dwMinimumCipherStrength;
DWORD dwMaximumCipherStrength;
DWORD dwSessionLifespan;
DWORD dwFlags;
DWORD reserved;
} SCHANNEL_CRED, *PSCHANNEL_CRED;
as in my proram i m using dwFlags
i m not understanding where is the problem.
Thanx for any suggesstion
-- modified at 5:42 Friday 9th September, 2005
|
|
|
|
|
Does anybody have any idea about where the resources are defined for Standard Message Boxes i.e. in which file and its path ? . What I mean to say is that how App knows to show OK string.I mean it can show Cancel string instead of OK. From where it loads those string. This must be in some rc file(Thats my assumption). Any idea. Any help would be appreciated.
Best Regards,
|
|
|
|