|
That just means it is a Unicode string. I have explained to you a number of times about your mishandling of Unicode and ASCII strings, and I suspect this is just another example.
Use the best guess
|
|
|
|
|
in excel, when enter a cell.no VBA functions are available.
how can I get the character or word after the cursor. or the whole line where the cursor located.
Any tips or reference will be appreciated.
I have done a lot research, but still have no idea.
|
|
|
|
|
Hi,
I am trying to open text file into a Excel Spreadsheet and I am getting all kinds of exceptions
below is my code as all but the filename paramter is optional I am wondering if someone can post a
example
COleVariant myvar;
myvar.vt = VT_I4;
myvar.lVal = NULL;
books.OpenText(TEXT("C:\\DOCUMENTS\\MYFILE.TXT"),
covOptional,
covOptional,
covOptional,
myvar.lVal,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional,
covOptional);
|
|
|
|
|
ForNow wrote: I am getting all kinds of exceptions You really need to show the exceptions, rather than hoping people can guess what they are.
Use the best guess
|
|
|
|
|
Hi,
I followed Microsoft Knoweldge base Article 178749
http://support.microsoft.com/kb/178749[^]
To create and an Automation When I got the Class wizard I selected Create Class from typelib
I the selcted the excel.exe
The Wizard create a number of Class I slected to include all of them in my project
After getting a Clean build I decided to add some ole code
create excel
So I included "CAppliction.h"
I coded CApplication app;
app.CreateDispatch("EXCEL APPLICATION");
however I got a whole slew of build errors
example
c:\users\4rypb\documents\visual studio 2010\projects\autoproject\autoproject\debug\excel.tlh(1595): error C2371: 'FontPtr' : redefinition; different basic types
1> c:\program files\microsoft visual studio 10.0\vc\include\comdef.h(314) : see declaration of 'FontPtr'
or
c:\users\4rypb\documents\visual studio 2010\projects\autoproject\autoproject\capplication.h(3): warning C4278: 'RGB': identifier in type library 'C:\\Program Files\\Microsoft Office\\Office14\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
Am I mssing some include ?
The doc says include excel8.h
but I dont see that included generated
Thanks
|
|
|
|
|
there's going to be different headers eg excel8.h, for different versions of Excel - you've already said you're using Excel 2010, so, an alarm bell goes off in my head straight away on that score ...
as to the rest, its been a long time since Ive needed to do this, but I found this article here in CP that may give you some more (and definately) better guidance ..
Automating Excel 2007 and creating charts using C++ MFC application in Visual Studio 2008[^]
(before you shoot me down in flames, please have a look at the article - it suggests it should be good for Excel 2010 as well, else I wouldnt have posted it)
|
|
|
|
|
commented out #import
Tnanks
|
|
|
|
|
Hi,
i am working for windows 8 wrapped credential provider .i did every thing in document which is provided by Microsoft .i implemented ICredentialProviderCredential2 interface with GetUserSid(__deref_out PWSTR *ppszSid) method,i am able to get sid .but my credential provider showing like other user tile ,but widows default credential showing password text box only,why my credential showing username text box and password text box. please help about this
Thanks
modified 24-Jul-13 4:55am.
|
|
|
|
|
Hi
I have developed Window service in .Net 2010 and in that windows service we are using Word COM object to covert DOC to PRN file.
if i run the window service in my local its working fine, but if i deploy the window service in Server 2008 R2 server i am getting below mentioned error, (Server 2008 R2 server Word 2003 is installed)
There is insufficient memory. Save the document now. (C:\...\ACL-PhillipSholar_1482.doc)
source Microsoft Word [System.Runtime.InteropServices.COMException]
at Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument, Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)
If any one know how to resolve the issue, Please let me share your fix.
Regards,
Ganesan. B
|
|
|
|
|
hi,
in my dll i am calling win32 dialog with custom control it working in 32 bit windows 8 machine but it is not display in 64 bit windows 8 machine. anyone tell me solution .
Thanks
|
|
|
|
|
You will need to provide a lot more detail if you want assistance with this.
Use the best guess
|
|
|
|
|
my dll is custom credential provider .this dll provide a link in windows logon screen,this link will display win32 dialog with custom control.this is working for windows 7 32&64 bit and windows 8 32bit.but 64 bit windows 8 every thing is coming fine dialog only not displaying .
Thanks
|
|
|
|
|
venkatesh52867 wrote: dialog only not displaying . Well that's the second time you have told us that, but without a lot more information it's anyone's guess what is happening.
Use the best guess
|
|
|
|
|
Hi,
i have implemented two interfaces in
class CSampleProvider : public ICredentialProvider,public ICredentialProviderSetUserArray
{
....
STDMETHOD (QueryInterface)(REFIID riid, void** ppv)
{
HRESULT hr;
if (IID_IUnknown == riid ||
IID_ICredentialProvider == riid || IID_ICredentialProviderSetUserArray )
{
*ppv = this;
reinterpret_cast<IUnknown*>(*ppv)->AddRef();
hr = S_OK;
}
else
{
*ppv = NULL;
hr = E_NOINTERFACE;
}
return hr;
}
........
};
it is building with out errors .but when i execute dll logonui is
crashing .how can implement two interfaces in one class please help me
|
|
|
|
|
venkatesh52867 wrote: but when i execute dll logonui is crashing You need to trace to the point of the error and show the code that crashes and the reason.
Use the best guess
|
|
|
|
|
Hi,
Problem is this
|| IID_ICredentialProviderSetUserArray when i call IID_ICredentialProviderSetUserArray interface through Quareyinterface dll is crashing without implementing ICredentialProviderSetUserArray interface dll is working is fine .
thanks
modified 19-Jun-13 7:21am.
|
|
|
|
|
I'm sorry, but no one can guess what your code is doing to cause the crash. As I said before, use your debugger to trace through it and identify exactly what is happening.
Use the best guess
|
|
|
|
|
Hi,
please check this code.i am highlighted with bold that code add then it is crashing.
#pragma once
#include <credentialprovider.h>
#include <windows.h>
#include <strsafe.h>
#include "PasswordResetCredential.h"
#include "helpers.h"
class CSampleProvider : public ICredentialProvider,public ICredentialProviderSetUserArray
{
public:
// IUnknown
STDMETHOD_(ULONG, AddRef)()
{
return _cRef++;
}
STDMETHOD_(ULONG, Release)()
{
LONG cRef = _cRef--;
if (!cRef)
{
delete this;
}
return cRef;
}
STDMETHOD (QueryInterface)(REFIID riid, void** ppv)
{
HRESULT hr;
if (IID_IUnknown == riid ||
IID_ICredentialProvider == riid ||IID_ICredentialProviderSetUserArray==riid)
{
*ppv = this;
reinterpret_cast<iunknown*>(*ppv)->AddRef();
hr = S_OK;
}
else
{
*ppv = NULL;
hr = E_NOINTERFACE;
}
return hr;
}
public:
IFACEMETHODIMP SetUsageScenario(CREDENTIAL_PROVIDER_USAGE_SCENARIO cpus, DWORD dwFlags);
IFACEMETHODIMP SetSerialization(const CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION* pcpcs);
IFACEMETHODIMP Advise(__in ICredentialProviderEvents* pcpe, UINT_PTR upAdviseContext);
IFACEMETHODIMP UnAdvise();
IFACEMETHODIMP GetFieldDescriptorCount(__out DWORD* pdwCount);
IFACEMETHODIMP GetFieldDescriptorAt(DWORD dwIndex, __deref_out CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR** ppcpfd);
IFACEMETHODIMP GetCredentialCount(__out DWORD* pdwCount,
__out DWORD* pdwDefault,
__out BOOL* pbAutoLogonWithDefault);
IFACEMETHODIMP GetCredentialAt(DWORD dwIndex,
__out ICredentialProviderCredential** ppcpc);
IFACEMETHODIMP SetUserArray (__in ICredentialProviderUserArray * users);
friend HRESULT CSampleProvider_CreateInstance(REFIID riid, __deref_out void** ppv);
protected:
CSampleProvider();
__override ~CSampleProvider();
private:
void _CleanUpAllCredentials();
private:
LONG _cRef;
CSampleCredential **_rgpCredentials; // Pointers to the credentials which will be enumerated by this
// Provider.
ICredentialProvider *_pWrappedProvider; // Our wrapped provider.
DWORD _dwCredentialCount; // The number of credentials provided by our wrapped provider.
DWORD _dwWrappedDescriptorCount; // The number of fields on each tile of our wrapped provider's
// credentials.
bool _bEnumeratedSetSerialization;
ICredentialProviderUserArray* _pCredProviderUserArray;
};
modified 19-Jun-13 10:45am.
|
|
|
|
|
Please format your code properly between <pre> tags, like:
STDMETHOD_(ULONG, Release)()
{
LONG cRef = _cRef--;
if (!cRef)
{
delete this;
}
return cRef;
}
Use the best guess
|
|
|
|
|
if (IID_IUnknown == riid ||
IID_ICredentialProvider == riid ||
IID_ICredentialProviderSetUserArray)
{
Do you see something missing here?
Use the best guess
|
|
|
|
|
hi,
ok but that is not problem when i called ICredentialProviderSetUserArray ==riid probblem is occurring
if (IID_IUnknown == riid ||
IID_ICredentialProvider == riid ||
IID_ICredentialProviderSetUserArray ==riid)
{
Thanks
|
|
|
|
|
You really need to do this[^]. Without a lot more information about what is actually happening at the time of the crash it's anyone's guess.
Use the best guess
|
|
|
|
|
Richard, Venkatesh
Are you certain that the old object is not getting out of scope when you create new. When you create multiple objects, chances are that you are not maintaining reference counts correctly so there is a small chance that object is actually removed or marked for removal when client attempts to access ...
As Richard quotes, this is my best guess 
|
|
|
|
|
It's been over a month; one can only assume OP fixed their code.
Use the best guess
|
|
|
|
|
The issue might lie in this statement:
*ppv = this;
Because you use a C-cast to type void*, type information is lost. The pointer does not point to the correct virtual table of the interface that you want to return.
Try the following instead:
STDMETHOD (QueryInterface)(REFIID riid, void** ppv)
{
HRESULT hr;
if (IID_ICredentialProviderSetUserArray == riid)
{
*ppv = dynamic_cast<ICredentialProviderSetUserArray>( this );
reinterpret_cast<IUnknown*>(*ppv)->AddRef();
hr = S_OK;
}
else if (IID_IUnknown == riid ||
IID_ICredentialProvider == riid )
{
*ppv = dynamic_cast<ICredentialProvider>( this );
reinterpret_cast<IUnknown*>(*ppv)->AddRef();
hr = S_OK;
}
else
{
*ppv = NULL;
hr = E_NOINTERFACE;
}
return hr;
}
|
|
|
|