|
The Office 11 PIAs (Primary Interop Assemblies) use .NET 1.1 (1.0.5000.0 for the .NET BCL assemblies), but you can redirect assembly versions to .NET 1.0 (1.0.3300.228 for .NET 1.0 BCL assemblies with SP2). Read Redirecting Assembly Versions[^] in the .NET Framework SDK for more information.
However, you should keep in mind that if you're not using any new features of Office 11 (2003), then you can use older interop assemblies. OLE automation - when done right like it is in Office - maintain backward compatibility (rarely have there been breaking changes in the typelibs for Office). But using a new interop assembly (which is created from a typelib) may not support older versions since interface IDs may be different.
If you want to support both Office XP and 2003, use the Office XP interop assemblies. They'll still work with Office 2003. If you want to support Office 2000 and newer, create interop assemblies for Office 2000. This should work all the way back to Office 97, but I wouldn't go beyond 2000, IMO.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I've implemented the IDropTargetHelper and IDragSourceHelper COM interfaces to augment my drag drop support. So far I can create the IDropTargetHelper interface and call the respective methods will absolutely no problem. I should be able to use the exact same logic to create and use an IDragSourceHelper objedt. For some reason I get the following error when trying to create the object:
"COM object with CLSID {DE5BF786-477A-11D2-839D-00C04FD918D0} is either not valid or not registered."
I've triple checked and the GUID is correct for the IDragSourceHelper interface. Does anyone know what can be done here? Does somet DLL need to be registered? I'm out of ideas.
Thanks
|
|
|
|
|
It's the IID (interface GUID) that's the problem, but the COM object GUID (that's what a CLSID is - a GUID for a class). You must have defined an interop class for the shell object that implements IDragSourceHelper .
See, you don't actually create an interface; an interface is abstract and can't be instantiated. What happens behind the scenes (in the CLR) is that the COM object is created and AddRef'd. The CLR QI's (QueryInterface) for the interface when you perform a cast and returns the interface you want (to which you're casting).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Perhaps I wasn't clear enough in my question...
I already have all the interop classes created. (That's was my point in saying I have everything working for the IDropTargetHelper interface). I wasn't suggesting I was trying to create an interface - I was sparing a paragraph spelling out what my already working code does. My question was why I can get the IDropTargetHelper working but not the IDragSourceHelper using the same overall logic.
Now - according to shlguid.h the IID for the drop helper (IID_IDropTargetHelper) is 4657278B-411B-11d2-839A-00C04FD918D0. That works - no problem there at all.
It would stand to reason, then, that the guid for IID_IDragSourceHelper would work for using the IDragSourceHelper interface. IID_IDragSourceHelper is DE5BF786-477A-11d2-839D-00C04FD918D0. That's the part that doesn't work - when I create the object derived from the IDragSourceHelper interface I get the message specified in my first post.
Oddly, the value 4657278B-411B-11d2-839A-00C04FD918D0 is in my registry in several places, while DE5BF786-477A-11d2-839D-00C04FD918D0 is not in my registry.
|
|
|
|
|
Look man, I don't know you. I don't know most of the people that show up in this forum looking for help. The only person I truly know here is Nick and I'm familiar with a few others that frequent this forum like Dave and Christian.
When people come to this forum, I assume nothing. I don't know if you know what you're doing. Since you're peering into header files and based on other information, it appears you do know what you're doing; but how could've I known that? As I said, I don't know you. So please don't get testy.
Sorry, it's just that I've been getting a lot of this crap lately because forums present faceless people sitting on a keyboard potentially on the other side of the world.
As for your questions and comments...
IIDs don't have to be registered, so the fact that IID_IDragSourceHelper isn't found in your registry isn't not surprising. Of course the CLSID must be registered, which I'm sure you know.
The documentation for both the IDropTargetHelper and IDragSourceHelper interfaces state that the COM object with CLSID_DragDropHelper implements both. When I import shell32.dll, however, this coclass isn't imported, so I'm curious where you got it (or did you declare the class yourself, which is entirely possible).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I three together the follow. The ComImportAttribute changes the metadata such that an instance is marked as imported and created from the attributed GUID. By casting, I am effectively QI'ing for the two interfaces.
In both cases, "False" is printed to the console, showing that the object does implement both interfaces. Sorry I don't have time to throw together a better sample (and keep in mind that when using interfaces not every method has to be defined (so long as they're in the correct VTBL order):
using System;
using System.Runtime.InteropServices;
[
GuidAttribute("4657278A-411B-11d2-839A-00C04FD918D0"),
ClassInterface(ClassInterfaceType.None),
ComImport
]
public class DragDropHelper : IDropTargetHelper, IDragSourceHelper
{
}
[
GuidAttribute("4657278B-411B-11d2-839A-00C04FD918D0"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
ComImport
]
public interface IDropTargetHelper
{
}
[
GuidAttribute("DE5BF786-477A-11d2-839D-00C04FD918D0"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
ComImport
]
public interface IDragSourceHelper
{
}
class Test
{
static void Main()
{
DragDropHelper helper = new DragDropHelper();
IDropTargetHelper dropHelper = (IDropTargetHelper)helper;
IDragSourceHelper dragHelper = (IDragSourceHelper)helper;
Console.WriteLine(dropHelper == null);
Console.WriteLine(dragHelper == null);
}
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi, guys, I have a form(window1) and I want click a button and then display another form(window2). If I use window2.ShowDialog(), window2 is displayed correctly. But I would like to use window2.Show(), the label control on the form can n't display correctly. Why/
Who can help me?
Thank you very much.
vigorous
|
|
|
|
|
If you include code, we can better help you. Does you you button handler look like this?
private void button_Click(object sender, EventArgs e)
{
OtherWindow other = new OtherWindow();
other.Show();
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Yes ,you are right. The code is very similar.
Do you know the reason of display incorrectly?
Thank you
vigorous
|
|
|
|
|
What exactly do you mean it "display[s] incorrectly?" Please be specific or we can't help you.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am importing data from file into arraylists. Then I use the arraylists to fill a DataTable that I use as a DataSource for a DataGrid. But when I refill the Grid with new data from files, selection by pressing rowheader gets slower and slower. I get a delay before the entire row is highlighted. If I select a cell first, then the rowheader for the row containing that cell, the delay is not there. It only happens after refilling the table/grid a couple of times. It alså happens if I add columns to the table at run time (after adding about 5 columns it gets a noticable delay). What is up with that?
-Atle
|
|
|
|
|
I want to check a string entered in a TextBox & check wether it has valid C# stements.. or a part of C# statements (maybe MessageBox es )
How can I do that?
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
yes.....it is:
if(string == "something"){ }
|
|
|
|
|
SJ_Phoenix wrote:
if(string == "something"){ }
This is not the best method for checking a string. Instead, do something below:
string s = "Nick";
if(string.Compare(s, "Nick") == 0)
{
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
To add, you can use String.Compare to perform case-insensitive searched by adding a bool as the third parameter. By default, this performs a comparison using the invariant culture, but you can specify a specific culture to perform a comparison using the text rules for that culture as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I think you're all missing the point.
He wants to evaluate a string to see if its contents are a valid C# code snippet, not a specific piece of text.
Not that I know the answer, mind you, but I thought I'd at least try to get the guy some help.
If it were me, I'd be looking at on-the-fly code compilation and let the compiler to the parsing.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
|
YES YES YES! Thank you.
I exactly want to do what Mr. Grim says. I am using a textbox where users have to enter a string, I need to validate if it is a valid C# statement. And is it possible to display the . (dot) operator menu..
Help PLZ
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
You will have to place the text into the context, and then compile it (via CodeDomSnippet or something). where are you planning on using the code?
top secret xacc-ide 0.0.1
|
|
|
|
|
Ok but how do you compile the code with .. CodeDomSnippet..?? & I'm trying to use the validation for a textbox. Users have to enter statements & they should be validated to true if they are valid C# statements.
HELP
PLZ
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
What you wanna do is way more complex than you can handle right now, I suggest you learn a bit more beforetrying to attempt something like this. A good understanding of parser and lexer technologies is essential.
top secret xacc-ide 0.0.1
|
|
|
|
|
Thanx for clearing that up..
Recources please!
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
Hi folks
I've got a new Problem using the UIPAB v2.0
I tried to implement a Wizard, but i didn't found any method for navigation nonlinear. The navigation graph wich is presented by the examples are only linear, but i have the problem that the following form depends on data wich is given in the wizard-page. So there are maybey two or more pages wich can follow another page.
Are there any possibilties to controll the navigation dependending on the data?
****************************
phoenixcp
Free Win2k and support Linux
****************************
|
|
|
|
|
If you have a problem with a specific product, you need to consult support for that product (or if it's from an article here on CodeProject, ask in the article's message board at the bottom of the article).
If you have a problem specific to C# (like how to marshal data, if necessary, using UIPAB), this is the place to ask.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Dear all:
My Org. use a Encryption for its passwords & I have to obey it too in my App to be the same as all other App. in Org.
In this Encryption we use entered values's Ascii & ...
I can get the ASCII value of Chars as:
(int)'A' = 65 & vise versa (char)65 = 'A'
but since I use Farsi(Arabic) Chars it gives me Unicode of that char like:
(int)'ش' = 1588
Is there any way to use its ASCII & not unicode?!
Of course, I can use change Farsi entered Chars to English to get its ASCII but some of Encrypted Chars are not English letters & I have to use them!
I realy need ur help bc all App. is waiting for that Login part
Thanks in Advance & Hope to hear from u ASAP!
Always ,
Hovik Melkomian.
|
|
|
|