|
I got S_FALSE when reading properties [pPropStg->ReadMultiple(nPidsi, pPropSpec, pPropVar)] since pPropStg return as S_OK.
#include <stdio.h>
#include <windows.h>
#include <ole2.h>
#include <locale.h>
void DumpSummaryProps(IPropertySetStorage *pPropSetStg) {
IPropertyStorage *pPropStg = NULL;
HRESULT hr;
PROPVARIANT propRead;
hr = pPropSetStg->Open(FMTID_SummaryInformation,
STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStg);
if(FAILED(hr))
{
printf("No Summary-Information.\n");
return;
}
struct pidsiStruct {
char *name;
long pidsi;
} pidsiArr[] = {
{"Title", PIDSI_TITLE},
{"Subject", PIDSI_SUBJECT},
{"Author", PIDSI_AUTHOR},
{"Keywords", PIDSI_KEYWORDS},
{"Comments", PIDSI_COMMENTS},
{0, 0}
};
int nPidsi = 0;
for(nPidsi=0; pidsiArr[nPidsi].name; nPidsi++);
PROPSPEC *pPropSpec = new PROPSPEC [nPidsi];
PROPVARIANT *pPropVar = new PROPVARIANT [nPidsi];
for(int i=0; i<npidsi; i++)="">
{
ZeroMemory(&pPropSpec[i], sizeof(PROPSPEC));
pPropSpec[i].ulKind = PRSPEC_PROPID;
pPropSpec[i].propid = pidsiArr[i].pidsi;
}
hr = pPropStg->ReadMultiple(nPidsi, pPropSpec, pPropVar);
<big>
if(FAILED(hr))
{
printf("IPropertyStg::ReadMultiple() failed w/error %08lx\n", hr);
}
else
{
int i;
for(i=0; i<npidsi; i++)="">
{
printf("%16s: ", pidsiArr[i].name);
DumpPropVariant(pPropVar + i);
}
}
delete [] pPropVar;
delete [] pPropSpec;
pPropStg->Release();
}
void DumpProps(char *filename) {
WCHAR wcFilename[1024];
setlocale( LC_ALL, "" );
int i = mbstowcs(wcFilename, filename, strlen(filename));
setlocale( LC_ALL, "C" );
wcFilename[i] = 0;
IStorage *pStorage = NULL;
IPropertySetStorage *pPropSetStg = NULL;
HRESULT hr;
hr = ::StgOpenStorageEx(wcFilename, STGM_READ | STGM_SHARE_EXCLUSIVE, STGFMT_FILE,
0, NULL, 0, IID_IPropertySetStorage, (void**)&pPropSetStg);
if (FALSE(hr))
{
printf("Error");
return;
}
DumpSummaryProps(pPropSetStg);
pPropSetStg->Release();
pStorage->Release();
}
void main()
{
char *s;
DumpProps("1.docx");
scanf("%s",&s);
}</npidsi;></npidsi;></locale.h></ole2.h></windows.h></stdio.h>
|
|
|
|
|
REPOST !!!
|
|
|
|
|
|
you wanted to say that to me ??
|
|
|
|
|
When i double click the dialog it does not go to Coding page.
It just show class wizard.When i click any control in dialog box, it shows only the class wizard.
I deleted the .clw file and again i create that. But No use.
Please help me?Any idea for this.
Anu
|
|
|
|
|
Yes, you have to first select a base class for it using class wizard.
|
|
|
|
|
It shows the classwizard of that corresponding dialog.
THis problem ocurs not only for single dialog.
Im using more than 50 dialogs for my application.The problem exists for all these dialogs.
When i double click the dialog..it shows the classwizard of that particular dialog.
Anu
|
|
|
|
|
Do you have any class for dialog?
|
|
|
|
|
Hi all,
i m new in feild of database, i m using MS-Access Database and SDI type Application in VC++2005,
i m using a CRecordset class for database, i m using the MoveNext() and MovePrev() for moving the records but its not working properly.
it is not move the record one by one.
Please Help me for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
This article will help you please check
Click here ->[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I m check this article in this article they read a table from Access Database and then show in List Ctrl.
But in my application i want the fetch the record from database and show in corresponding edit box of dialog, one by one.
Thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Ok.Please explain more what's an issue,when you click button move next or prev??
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I m working on SDI type application.
I have design a dialog Box with help of Diffrent Editbox and Combobox,
and then i have created a table according to field of dialog box.
i have one FormView ,in CFormView Dreived class i m using a List ctrl Where i show all list of data which is Present in database.
when i Double click on List record then dialog box is open and fetch
all corresponding Values from database and show in dialog box.
now i want when i click on Next Or Prev Button the record Move on next or Prev record and show corresponding Value in Dialog box.
But it is not happend here, when i click on Next or Prev Button it move but only one fix record in both cases nex and Prev.
Thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi everyone,
I installed VS2008 on the xp and I use of it without any problem,but on the Vista I cant make a MFC projects correctly,on the New Project I select MFC Application and after click Ok I select Dialog Base for Application Type when I click Finish Button I get this message "class doesnt support automation" and it returns to New project window except this error I have other problem when I open exist projects that I made on the VS2005 it cant open Resouce(rc file) and show me Load Failed ,I reinstall visual studio 2008 but I have this problem.
does this problem with Visual studio 2008 or problem is of Vista(64bit)
How can I solve this problem?
Thanks
|
|
|
|
|
Hi All,
I basically use this to load/display a .jpg file.
if (OleLoadPicture(pStream,dwSize,FALSE,IID_IPicture,
reinterpret_cast<LPVOID *>(&m_pPicture)) != S_OK)
{
pStream->Release();
return 10;
};
pStream->Release();
This code is working fine for most of the files with all the .jpg files with RGB Color mode.
But for a .jpg file created with CMYK(Cyan, Magenta, Yellow, KeyColor-Black), I am not able to open the file, I get the error "E_NOINTERFACE - The object does not support the interface specified in riid(IID_IPicture in the function)." - Unable to get the image interface.
Kindly help!
Thanks.
Priya Sundar
modified on Tuesday, May 20, 2008 5:29 AM
|
|
|
|
|
Try with this code(Does it work?):
CImage m_Image;
m_Image.Load(_T("c:\\1.jpg"));
m_Image.BitBlt(GetDC()->m_hDC,0,0);
...
...
And also you can use of GDI+
|
|
|
|
|
Sorry. I am programming in SDK using 'IPicture' interface.
Priya Sundar
|
|
|
|
|
This article will help you
Click here ->[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Well Shilpi, I have tried to display my picture in the same way only.
However, I have now located the actual problem. The function doesnt display the .jpg files with a CMYK(Cyan, Magenta, Yellow, KeyColour-Black) colur mode.
I want to display files with .jpg extension but in the colour mode of CMYK.
Priya Sundar
|
|
|
|
|
Hi All,
Can anyone suggest me best & simple way to use MySQL database in VC++6.0 environment ? I may move to Visual Studio 2005 or 2008 but at this point I want to start with VC6 to reduce dealing other issues. I have never used MySQL so I'm very new so looking some stable wrapper library for it and I heard about MySQL++ and don't see much people talking about it. I read on their FAQs that it's not well supported on VC6.0 due to STL issues so I can think about using 2005 then. Any comments are highly appreciated.
thanks.
modified on Monday, May 19, 2008 9:52 PM
|
|
|
|
|
1)[^]2)[^]3)[^]
these all will help you to sort your problem
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
hi Shilpi,
thx for reply. So you think using MySQL++ is good idea then ?
|
|
|
|
|
Hi,
I have created a new COM DLL and just wondering how to return a new COM object.
Here is my code (in COM DLL) to return a new object.
HRESULT __stdcall CMainTestClass::GetSamTest(IAdd **ppRetVal)
{
CAddClass *pAddClass = new CAddClass();
*ppRetVal = pAddClass;
return S_OK;
}
When I call this function in C#, it gave me this error:
The runtime has encountered a fatal error. The address of the error was at 0x7f628678, on thread 0x105c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
My C# code:
MyTestLib.MainTestClass oMainObject = new MyTestLib.MainTestClass();
MyTestLib.AddClass addObject = (oMainObject .GetSamTest() as MyTestLib.AddClass );
MessageBox.Show(addObject.DoTheAddition().ToString());
Thanks for any help
|
|
|
|
|
I look for code in matrix calcs. Plz help find.
|
|
|
|
|
Please see this[^]
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|