Click here to Skip to main content
15,843,727 members
Home / Discussions / COM
   

COM

 
GeneralRe: Getting Excel sheet names Pin
Richard MacCutchan3-Oct-09 1:39
mveRichard MacCutchan3-Oct-09 1:39 
GeneralRe: Getting Excel sheet names Pin
gtag3-Oct-09 1:43
gtag3-Oct-09 1:43 
GeneralRe: Getting Excel sheet names Pin
gtag12-Nov-09 19:31
gtag12-Nov-09 19:31 
QuestionCall an COM Server dispinterface C++ Pin
Juergen_8030-Sep-09 5:58
Juergen_8030-Sep-09 5:58 
AnswerRe: Call an COM Server dispinterface C++ Pin
Juergen_801-Oct-09 22:14
Juergen_801-Oct-09 22:14 
AnswerRe: Call an COM Server dispinterface C++ Pin
Stuart Dootson1-Oct-09 23:03
professionalStuart Dootson1-Oct-09 23:03 
QuestionWMP SDK 11 audio and video file DRM and attribute querying Pin
Barney Wray29-Sep-09 6:17
Barney Wray29-Sep-09 6:17 
QuestionIShellLinkW getArguments gives some strange symbols instead of the shortcuts' arguments Pin
coderomega26-Sep-09 12:26
coderomega26-Sep-09 12:26 
Hi,
I am trying to retrieve a shortcut's arguments but when I do so, I get some strange random/chinese symbols.
I've checked multiple times the code and I can't see any reason why this is happening.

I also use the IShellLinkW GetPath, but I have no problem with it.

here is the code I have :

[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WIN32_FIND_DATAW
{
    public int dwFileAttributes;
    public FILETIME ftCreationTime;
    public FILETIME ftLastAccessTime;
    public FILETIME ftLastWriteTime;
    public int nFileSizeHigh;
    public int nFileSizeLow;
    public int dwReserved0;
    public int dwReserved1;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
    public string cFileName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
    public string cAlternateFileName;
}

[ComImportAttribute()]
[GuidAttribute("000214F9-0000-0000-C000-000000000046")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IShellLinkW
{
    void GetPath([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile,
                int cchMaxPath,
                out WIN32_FIND_DATAW pfd,
                uint fFlags);


    void GetArguments([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs,
                int cchMaxPath);
}


[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
Guid("0000010B-0000-0000-  C000-000000000046")]
public interface IPersistFile
{
    [PreserveSig]
    void IsDirty();

    void GetClassID(out Guid pClassID);

    void Load([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, uint dwMode);
}

[ComImport(), Guid("00021401-0000-0000-C000-000000000046")]
public class ShellLink
{
}


public class ShortcutTargetInfo
{
    internal static string getArguments(string shortcutPath)
    {
        IShellLinkW linkW = (IShellLinkW)new ShellLink();
        ((IPersistFile)linkW).Load(shortcutPath, 0);

        StringBuilder sb = new StringBuilder(260);

        linkW.GetArguments(sb, sb.MaxCapacity);

        Marshal.ReleaseComObject(linkW);
        linkW = null;
        return sb.ToString();
    }
}


can anyone help me find the cause of this strange behavior.
Questionhow to use an interface belong to another library in idl file Pin
samfromcn26-Sep-09 2:26
samfromcn26-Sep-09 2:26 
AnswerRe: how to use an interface belong to another library in idl file Pin
«_Superman_»26-Sep-09 7:49
professional«_Superman_»26-Sep-09 7:49 
GeneralRe: how to use an interface belong to another library in idl file [modified] Pin
samfromcn26-Sep-09 16:50
samfromcn26-Sep-09 16:50 
AnswerRe: how to use an interface belong to another library in idl file Pin
Vi228-Sep-09 21:14
Vi228-Sep-09 21:14 
QuestionMake Extra Cash At Home Pin
aqasim25-Sep-09 2:21
aqasim25-Sep-09 2:21 
AnswerRe: Make Extra Cash At Home Pin
Stuart Dootson25-Sep-09 3:38
professionalStuart Dootson25-Sep-09 3:38 
AnswerRe: Make Extra Cash At Home Pin
Richard MacCutchan25-Sep-09 6:56
mveRichard MacCutchan25-Sep-09 6:56 
QuestionRendering html pages wth mshtml alone (no webbrowser object or shdocvw!) Pin
gxie23-Sep-09 17:46
gxie23-Sep-09 17:46 
AnswerRe: Rendering html pages wth mshtml alone (no webbrowser object or shdocvw!) Pin
«_Superman_»23-Sep-09 21:38
professional«_Superman_»23-Sep-09 21:38 
GeneralRe: Rendering html pages wth mshtml alone (no webbrowser object or shdocvw!) Pin
gxie24-Sep-09 4:03
gxie24-Sep-09 4:03 
GeneralRe: Rendering html pages wth mshtml alone (no webbrowser object or shdocvw!) Pin
«_Superman_»24-Sep-09 22:25
professional«_Superman_»24-Sep-09 22:25 
QuestionHow to use Mysql Database in ATLCOM project. Pin
Rits11038923-Sep-09 2:22
Rits11038923-Sep-09 2:22 
AnswerRe: How to use Mysql Database in ATLCOM project. Pin
Rits11038915-Oct-09 21:54
Rits11038915-Oct-09 21:54 
Questioncorba application from java to java Pin
jayshree1822-Sep-09 3:50
jayshree1822-Sep-09 3:50 
AnswerRe: corba application from java to java Pin
Richard MacCutchan22-Sep-09 5:45
mveRichard MacCutchan22-Sep-09 5:45 
Questionexpression cannot be evaluated:0x0046d5b0 _com_error Pin
gtag17-Sep-09 22:06
gtag17-Sep-09 22:06 
AnswerRe: expression cannot be evaluated:0x0046d5b0 _com_error Pin
Stuart Dootson17-Sep-09 22:46
professionalStuart Dootson17-Sep-09 22:46 

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.