Click here to Skip to main content
15,907,281 members
Home / Discussions / C#
   

C#

 
GeneralRe: HTML code to string Pin
Alex Grose12-Oct-08 7:29
Alex Grose12-Oct-08 7:29 
QuestionBasic mp3/media player problem :( Pin
jas0n2312-Oct-08 4:23
jas0n2312-Oct-08 4:23 
AnswerRe: Basic mp3/media player problem :( Pin
Giorgi Dalakishvili12-Oct-08 4:47
mentorGiorgi Dalakishvili12-Oct-08 4:47 
QuestionHiding control properties, Creating serializable control Pin
Andy Rama12-Oct-08 4:01
Andy Rama12-Oct-08 4:01 
AnswerRe: Hiding control properties, Creating serializable control Pin
DaveyM6912-Oct-08 6:25
professionalDaveyM6912-Oct-08 6:25 
QuestionRe: Hiding control properties, Creating serializable control Pin
Andy Rama28-Oct-08 22:41
Andy Rama28-Oct-08 22:41 
AnswerRe: Hiding control properties, Creating serializable control Pin
DaveyM6929-Oct-08 2:33
professionalDaveyM6929-Oct-08 2:33 
QuestionStgOpenStorageEx() Pin
Miss_hacker12-Oct-08 3:41
Miss_hacker12-Oct-08 3:41 
hi why this code didn't execute??? what are my errors
using System;
using System.Runtime.InteropServices;
namespace StgOpen
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{

public enum STGM:int
{
DIRECT= 0X00000000,TRANSACTED=0X00010000,READ=0X00000000}



[ComImport]
[Guid("0000000b-0000-0000-C000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPropertyStorage
{
void CreateStream(
/* [string][in] */ string pwcsName,
/* [in] */ uint grfMode,
/* [in] */ uint reserved1,
/* [in] */ uint reserved2,
/* [out] */ out IStream ppstm);

void OpenStream(
/* [string][in] */ string pwcsName,
/* [unique][in] */ IntPtr reserved1,
/* [in] */ uint grfMode,
/* [in] */ uint reserved2,
/* [out] */ out IStream ppstm);

void CreateStorage(
/* [string][in] */ string pwcsName,
/* [in] */ uint grfMode,
/* [in] */ uint reserved1,
/* [in] */ uint reserved2,
/* [out] */ out IStorage ppstg);

void OpenStorage(
/* [string][unique][in] */ string pwcsName,
/* [unique][in] */ IStorage pstgPriority,
/* [in] */ uint grfMode,
/* [unique][in] */ IntPtr snbExclude,
/* [in] */ uint reserved,
/* [out] */ out IStorage ppstg);

void CopyTo(
/* [in] */ uint ciidExclude,
/* [size_is][unique][in] */ Guid rgiidExclude, // should this be an array?
/* [unique][in] */ IntPtr snbExclude,
/* [unique][in] */ IStorage pstgDest);

void MoveElementTo(
/* [string][in] */ string pwcsName,
/* [unique][in] */ IStorage pstgDest,
/* [string][in] */ string pwcsNewName,
/* [in] */ uint grfFlags);

void Commit(
/* [in] */ uint grfCommitFlags);

void Revert();

void EnumElements(
/* [in] */ uint reserved1,
/* [size_is][unique][in] */ IntPtr reserved2,
/* [in] */ uint reserved3,
/* [out] */ out IEnumSTATSTG ppenum);

void DestroyElement(
/* [string][in] */ string pwcsName);

void RenameElement(
/* [string][in] */ string pwcsOldName,
/* [string][in] */ string pwcsNewName);

void SetElementTimes(
/* [string][unique][in] */ string pwcsName,
/* [unique][in] */ FILETIME pctime,
/* [unique][in] */ FILETIME patime,
/* [unique][in] */ FILETIME pmtime);

void SetClass(
/* [in] */ Guid clsid);

void SetStateBits(
/* [in] */ uint grfStateBits,
/* [in] */ uint grfMask);

void Stat(
/* [out] */ out STATSTG pstatstg,
/* [in] */ uint grfStatFlag);


}

[StructLayout(LayoutKind.Sequential)]
public struct STGOPTIONS
{
[FieldOffset(0)] ushort usVersion;
[FieldOffset(2)] ushort reserved;
[FieldOffset(4)] uint uiSectorSize;
[FieldOffset(8),MarshalAs(UnmanagedType.LPWStr)]string pwcsname;
}


[DllImport("ole32.dll")]
public static extern int StgOpenStorageEx([MarshalAs(UnmanangedType.lPWStr)]
string pwcsname,int grfMode,int stgfmt,int grfAttrs,ref STGOPTIONS pStgOptions,
IntPtr reserved2,[In] ref Guid riid,[MarshalAs(UnmanangedType.IUnknown)] out object ppobjectOpen);
}
[STAThread]
public static void Main(string[] args)
{



string file=@"E:\\Miss_Hacker.doc";
int result=StgOpenStorageEx(file,STGM.READ,STGFMT.DOCFILE,2,null,IntPtr.zero,ref IID_IPropertyStorage,out object ppObjectOpen);
Console.WriteLine("{0}",result);
}
}
AnswerRe: StgOpenStorageEx() Pin
Dave Kreskowiak12-Oct-08 4:34
mveDave Kreskowiak12-Oct-08 4:34 
GeneralRe: StgOpenStorageEx() Pin
Miss_hacker12-Oct-08 6:27
Miss_hacker12-Oct-08 6:27 
GeneralRe: StgOpenStorageEx() Pin
Dave Kreskowiak12-Oct-08 7:35
mveDave Kreskowiak12-Oct-08 7:35 
GeneralRe: StgOpenStorageEx() Pin
Colin Angus Mackay12-Oct-08 12:08
Colin Angus Mackay12-Oct-08 12:08 
GeneralRe: StgOpenStorageEx() Pin
Dave Kreskowiak12-Oct-08 14:02
mveDave Kreskowiak12-Oct-08 14:02 
GeneralRe: StgOpenStorageEx() Pin
Colin Angus Mackay12-Oct-08 14:11
Colin Angus Mackay12-Oct-08 14:11 
GeneralRe: StgOpenStorageEx() Pin
led mike12-Oct-08 18:21
led mike12-Oct-08 18:21 
AnswerRe: StgOpenStorageEx() Pin
DaveyM6912-Oct-08 6:43
professionalDaveyM6912-Oct-08 6:43 
RantRe: StgOpenStorageEx() Pin
Paul Conrad12-Oct-08 8:09
professionalPaul Conrad12-Oct-08 8:09 
QuestionPermanent repaint of button at mouse click Pin
Zeddan11-Oct-08 17:05
Zeddan11-Oct-08 17:05 
AnswerRe: Permanent repaint of button at mouse click Pin
Mycroft Holmes11-Oct-08 17:44
professionalMycroft Holmes11-Oct-08 17:44 
GeneralRe: Permanent repaint of button at mouse click Pin
Zeddan11-Oct-08 18:00
Zeddan11-Oct-08 18:00 
GeneralRe: Permanent repaint of button at mouse click Pin
Dave Kreskowiak12-Oct-08 4:26
mveDave Kreskowiak12-Oct-08 4:26 
AnswerRe: Permanent repaint of button at mouse click Pin
DaveyM6911-Oct-08 20:36
professionalDaveyM6911-Oct-08 20:36 
QuestionInserting image in header/footer of a word document Pin
Punitha_V11-Oct-08 7:09
Punitha_V11-Oct-08 7:09 
RantRe: Inserting image in header/footer of a word document Pin
Pedram Behroozi11-Oct-08 7:26
Pedram Behroozi11-Oct-08 7:26 
AnswerRe: Inserting image in header/footer of a word document Pin
Mohammad Dayyan12-Oct-08 0:14
Mohammad Dayyan12-Oct-08 0:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.