473,543 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IQueryInfo driving me insane

Hi

I am trying to make a little tool tip box pop up when you hover the
mouse over one of our custom filetypes in Windows explorer. And it is
slowly driving me insane.

I have a created a dll, with this as the code:

using System;
using System.IO;
using System.Runtime. InteropServices ;
using Microsoft.Win32 ;

[ComImport(), Guid("0000010B-0000-0000-C000-000000000046"),
InterfaceType(C omInterfaceType .InterfaceIsIUn known)]
public interface IPersistFile
{
[PreserveSig]
uint GetClassID(out Guid pClassID);

[PreserveSig]
uint IsDirty();

[PreserveSig]
uint Load([In, MarshalAs(Unman agedType.LPWStr )] string pszFileName,
[In] uint dwMode);

[PreserveSig]
uint Save([In, MarshalAs(Unman agedType.LPWStr )] string pszFileName,
[In] bool fRemember);

[PreserveSig]
uint SaveCompleted([In, MarshalAs(Unman agedType.LPWStr )] string
pszFileName);

[PreserveSig]
uint GetCurFile([MarshalAs(Unman agedType.LPWStr )] out string
ppszFileName);
}

[ComImport(), Guid("00021500-0000-0000-C000-000000000046"),
InterfaceType(C omInterfaceType .InterfaceIsIUn known)]
public interface IQueryInfo
{
[PreserveSig]
uint GetInfoTip(uint dwFlags, out IntPtr pszInfoTip);

[PreserveSig]
uint GetInfoFlags(ou t uint dwFlags);
}

[ComVisible(true ), Guid("A2C92C9B-55C8-4d6a-A56E-A7047072F26E")]
public class MyShellInfoClas s : IPersistFile, IQueryInfo
{
private const uint E_NOTIMPL = 0x80004001;
private const uint S_OK = 0;
private const uint QITIPF_DEFAULT = 0;
private string tip = string.Empty;

public uint GetInfoFlags(ou t uint dwFlags)
{
StreamWriter batWriter = File.CreateText ("c:/
hamsterWillRule TheWorld.txt"); batWriter.Write Line("Hamsters will rule
the world"); batWriter.Close ();
dwFlags = QITIPF_DEFAULT;
return S_OK;
}

public uint GetInfoTip(uint dwFlags, out IntPtr pszInfoTip)
{
StreamWriter batWriter = File.CreateText ("c:/
hamsterWillRule TheWorld.txt"); batWriter.Write Line("Hamsters will rule
the world"); batWriter.Close ();
// after calling Load, the shell calls this
// method to get the actual info
pszInfoTip = Marshal.StringT oCoTaskMemUni(t ip);
return S_OK;
}

public uint IsDirty()
{
StreamWriter batWriter = File.CreateText ("c:/
hamsterWillRule TheWorld.txt"); batWriter.Write Line("Hamsters will rule
the world"); batWriter.Close ();
return E_NOTIMPL;
}

public uint Load(string pszFileName, uint dwMode)
{
StreamWriter batWriter = File.CreateText ("c:/
hamsterWillRule TheWorld.txt"); batWriter.Write Line("Hamsters will rule
the world"); batWriter.Close ();
// shell calls this method when it needs info
// for a particular file. This tells your
// component which file you need to process.
tip = "You are hovering over: " + pszFileName;
return S_OK;
}

public uint Save(string pszFileName, bool fRemember)
{
StreamWriter batWriter = File.CreateText ("c:/
hamsterWillRule TheWorld.txt"); batWriter.Write Line("Hamsters will rule
the world"); batWriter.Close ();
return E_NOTIMPL;
}

public uint SaveCompleted(s tring pszFileName)
{
StreamWriter batWriter = File.CreateText ("c:/
hamsterWillRule TheWorld.txt"); batWriter.Write Line("Hamsters will rule
the world"); batWriter.Close ();
return E_NOTIMPL;
}

public uint GetCurFile(out string ppszFileName)
{
StreamWriter batWriter = File.CreateText ("c:/
hamsterWillRule TheWorld.txt"); batWriter.Write Line("Hamsters will rule
the world"); batWriter.Close ();
ppszFileName = null;
return E_NOTIMPL;
}

public uint GetClassID(out Guid pClassID)
{
StreamWriter batWriter = File.CreateText ("c:/
hamsterWillRule TheWorld.txt"); batWriter.Write Line("Hamsters will rule
the world"); batWriter.Close ();
pClassID = Guid.Empty;
return E_NOTIMPL;
}
}

I have added the following to the registry:

HKEY_CLASSES_RO OT\.wibble\shel lex\{00021500-0000-0000-
C000-000000000046}\{ a2c92c9b-55c8-4d6a-a56e-a7047072f26e}

I've copied the built dll to C:\windows\asse mbly

And I've run:

regasm MyShellInfoClas s.dll

But as far as I can tell none of my functions are ever getting called :
( I've tried everything I can think of and it is about to drive me
insane. Please, someone, help me....

Kevin

Feb 12 '07 #1
1 2025
In article <11************ **********@h3g2 000cwc.googlegr oups.com>,
ro********@gmai l.com says...
I've copied the built dll to C:\windows\asse mbly

And I've run:

regasm MyShellInfoClas s.dll

But as far as I can tell none of my functions are ever getting called :
( I've tried everything I can think of and it is about to drive me
insane. Please, someone, help me....
I would try giving it a strong name and adding it to the GAC (global
assembly cache).

--
Patrick Steele
http://weblogs.asp.net/psteele
Feb 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1602
by: Chris | last post by:
Dear all, Its IE again which is doing funny things to my page at http://www.bangor.ac.uk/webteam/uwb_template/blue/website/template.php Works as expected in Moz browsers - but IE makes the light blue box adjacent to the image slightly larger - and im going insane trying to work it out! Any spotters out there to help me from going...
7
2050
by: Jim | last post by:
I really hope someone can help me with the below problem. It's driving me insane. I have a form with two combo boxes (say, combo1 and combo2) and a list box (listbox1). When the user selects a value in combo1, the AfterUpdate event kicks in, does some stuff, and moves focus to combo2. The code looks something like this: Private Sub...
2
1560
by: Grey Knight | last post by:
Here's a problem which is driving me slowly insane. Using GCC version 3.3.1 on SuSE 9.0, I keep getting "undefined reference to `function'"-type errors for no apparent reason! It's driving me bonkers. Here's a tiny sample program which reproduces the problem. I've also included an extract of the shell session I used to launch it (so you can...
2
3024
by: Alan Bahm | last post by:
Hi all, I'm trying to write an InfoTip extension for my filetype in explorer (running on WinXP & W2K). The interface IQueryInfo supports this feature (with some help from IPersistFile), through the function call GetInfoTip. GetInfoTip requires that you return a string for the InfoTip that is allocated off of CoTaskMem, so that the...
4
8785
by: Jeff F | last post by:
Any thoughts on correcting this error? Here is the source: // PrjFileInfo.h : Declaration of the CPrjFileInfo #pragma once #include "resource.h" // main symbols #include "AdvShellX.h"
12
1592
by: Marty | last post by:
It seems all of the sudden that user controls that contain images are referencing image sources relative to the document that I drop the control on. This obviously does not work beacuase the image source is relative to the user control, not necessarily the form. Can anyone tell me why this would be the case?
2
1359
by: ipmccun | last post by:
Hello all: Perhaps someone can shed some light on this: I'm trying to create a situation, while debugging, where a long running request (sleeps for 15s) and a short running request execute concurrently. Right now, no matter what I do, it seems that they execute serially. I've verified (by watching netstat) that two simultaneous...
2
3203
by: aidanhaylock | last post by:
Morning, This one is really driving me insane. I am developing a site for a client who doesn't particularly want to move their hosting away from their current provider. The current host are absolutely terrible with their support (shocking for a large hosting company) and I am running out of ideas. I usually use Dreamweaver to it's full...
0
7399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7584
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7729
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7332
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5258
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4884
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3385
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.