|
Does this work out for you?
SFGAO_HASSUBFOLDER = (UInt32)0x80000000, // may contain children with SFGAO_FOLDER
SFGAO_CONTENTSMASK = (UInt32)0x80000000,
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
I've converted the flag enum to uint... though i'm not sure how that's going to affect the COM object i'm going to be using it with.
Thanks for the idea though
Cata
|
|
|
|
|
It won't, so long as you don't cause an overflow. While the -1 (Int32) is 4,294,967,295 (UInt32), the number is still 0xffffffff. It's not uncommon to use ing instead of uint for parameter types like DWORD s. Even Microsoft does it when manually declaring COM interfaces that they use internally (or those few in System.Runtime.InteropServices that you can use).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have two classes:
abstract public class BasicClass
{
public string name;
public BasicClass(string name)
{
this.name = name;
}
abstract public void TestMethod(...);
}
... and ...
public class TestClass: BasicClass
{
public override void TestMethod(...)
{
...
}
}
Why do I get an error at public class TestClass that says:
"No overload for method 'BasicClass' takes '0' arguments".
I don't get it ...
Regards, Desmond
|
|
|
|
|
You have to overwrite the constructor.
The constructor 'BasicClass' takes one argument, so one constructor for 'TestClass' should be:
public TestClass(String name):base(name){...}
|
|
|
|
|
Your TestClass has no constructor, so the framework makes a default one for you. It has to call the base contructor. The BasicClass has no default constructor because you defined a constructor with an argument.
Some suggestions:
public class TestClass: BasicClass
{
public TestClass() : base("")
{
}
public override void TestMethod(...)
{
...
}
}
or
abstract public class BasicClass
{
public string name;
public BasicClass()
{
this.name = "";
}
public BasicClass(string name)
{
this.name = name;
}
abstract public void TestMethod(...);
}
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
Maybe somebody could help me?..
I've build in .NET C# kind of wrapper object to my old COM server (it simply contains that COM server interface pointer inside and exports almost the same properties/methods outside redirecting all calls to that COM interface). Definitely, in order to use COM server in .NET I've generated interop for it. My wrapper resides in its own assembly which uses in runntime (as I supposed) that interop but, the problem appears when I compile module which uses my wrapper: C# compiler asks to add to reference that COM interop also because it can't find definition of that internal COM interface!?. My question is why in compile time C# compiler has to know about internal implementation of my assembly ? I do not export any interface or type from that COM interop, moreover the purpose of this wrapper is to hide COM implementation !.. Is it any way to include that interop in my assembly?.
Thanks in advance, Vlad.
|
|
|
|
|
Because the interop assembly is a dependency of the assembly containing your wrapper, which is a dependency of the assembly using the wrapper. Because the wrapper uses the interop assembly internally, it must be able to reference it in order to compile. Even if both of these assemblies are compiled and added as .NET references (as opposed to project references when using all of them in a single solution), the interop assembly is required in order to load the wrapper assembly. It's also possible that you might be using a Type from the interop assembly as a publicly exposed param, return type, interface, or struct so that would force a dependency resolution.
Basically, any dependencies - whether direct or indirect - must be resolvable when compiling and when running, so long as the Type is access (which foces a JIT compilation).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath, thanks for reply...
Look, I've cheked my assembly code one more time and see no Type from the interop assembly publicly exposed... The compiler generates error on my wrapper construction (new instantination) line of code and wants to include COM interop in oder to get iterop-wrapped COM interface type which I use internally (as private data member) in my C# wrapper class and in its contructor I create new instance of that COM class...
I simply do not understand something: is it so different from C++ where during compile time it is enough just function declaration... or (just another thought ) it is so similar to C++ inline/template functions where compiler has to read the code of the function in order to generate inline/template implementation?.
Thanks, Vlad.
|
|
|
|
|
C/C++ links against the addresses of functions, where .NET compilers must load the assembly in order link to Types and members. If that assembly has dependencies, those dependencies must be resolved.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks, from now it's understandable
Just last question... Can I put two or more interops/assemblies together into one file?
Thanks, Vlad
|
|
|
|
|
Not two assemblies, no, but you can combine zero or more modules in an assembly. A module is the code without the metadata that makes up an assembly. In order to do this, you'd have to use ildasm.exe to disassemble both assemblies, combine the two IL files from each module (from each assembly, paying attention to how IL is formatted), then use ilasm.exe to reassemble after adding the assembly attributes from one assembly to the IL for the other, new assembly that you're creating.
Another way is to just define the COM interop classes, interfaces, etc. yourself, which Microsoft commonly did in the base class libraries. Make sure you understand marshaling and COM interoperability, though. You can learn a lot by looking through the System.Runtime.InteropServices namespace and several other sections of the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm working on a little project for school and I'm having a little problem with selecting a button.
I have some buttons and I have to detect which 2 buttons I just clicked so I can compare the values in it. How do I do that?
I can compare the two values, so that's not the problem, I want to know how to select two unknown buttons.
My code looks a bit like this
<br />
int comp1;<br />
int comp2;<br />
<br />
Button btncompare1;<br />
Button btncompare2;<br />
<br />
btncompare1=button1;<br />
btncompare2=button2;<br />
<br />
comp1=Convert.ToInt32(btncompare1.Text);<br />
comp2=Convert.ToInt32(btncompare2.Text);<br />
<br />
if(comp1>comp2)<br />
...<br />
<br />
I hope you understand my problem!!!
Thanks
|
|
|
|
|
What about using two global variables (or an array, even better), and a counter. Then, when one button is clicked, the reference to the instance is saved in the first position, and when another button is clicked, it is saved in the second. Like this:
public class MyClass
{
private Button[] _buttons = new Button[2];
private int _counter = 0;
public MyClass()
{
MyButton1.Click += new EventHandler(Button_Click);
MyButton2.Click += new EventHandler(Button_Click);
MyButton3.Click += new EventHandler(Button_Click);
}
private void Button_Click(object sender, EventArgs e)
{
_buttons[_counter] = (Button)sender;
_counter++;
}
}
Instead of manually assigning the events to your buttons in the class' constructor, you may want to use the Form-designer to do that. Just copy-and-paste the name of the method that handles the event in the field next to 'Click' on the 'Events' tab of the propertygrid of your buttons.
Don't forget to reset the counter (_counter = 0 ) when you're finished, or add a check to see whether _counter > _buttons.Length - 1 , then:
if (_counter > _buttons.Length - 1) _counter = 0;
|
|
|
|
|
Ok thanks it works now!
|
|
|
|
|
When I open my printPreviewDialog my Document shows fine in the dialog, but when i click on print it prints only the Headers of the document. Does anyone know what could be wrong?
|
|
|
|
|
please let me know a way to use adobe libraries in C# programes to accomplish conversion to pdf.
|
|
|
|
|
I've read that the Adobe libraries, even in their current version, are unwieldy and not very developer-friendly. There are several vendors that publish COM/ActiveX/.NET libraries for converting/creating PDF documents. I've used ActivePDF with success, and colleagues have used others equally successfully. Some are even advertised here on CP, if you hang around long enough.
|
|
|
|
|
yes, i too have used pdflib but i will have adobe acrobat installed, so my client doesnt prefer to buy other third party software. so i should use only adobe libraries. got any way out
|
|
|
|
|
I know there was a recent article somewhere... but I cannot remember where just now. Another article on www.west-wind.com dealt with this, however the code samples are in Visual FoxPro; the principals are the same, but you might go bald trying to re-work VFP into C#...
|
|
|
|
|
There is a tool called tallpdf I have used for convertion of pdf. This component is fully .NET compatible and the information is available in www.pdfzone.com/toolbox/TallPDF.html.
|
|
|
|
|
Many of the PDF converts to which John referred are royalty-free, meaning the client won't have to buy anything (unless you are writing this for a specific cient as part of a contract or something similar).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi..theres a software called ghostsript that can convert from doc to pdf thats a open source and its free..
thank you
|
|
|
|
|
I am using VisualStudio.NET 2002 with .NET Framework 1.0 Actually i am developing a program in which i have to use Browser Control. I have used it on a control which facilitate me in providing wizard. Actually it is a wizard control on which i have used WebBrowser Control. Now i have start it both bu using Debug and without debu it is alright. Now i have created a form in which i call this wizard. Now if i run this program without using debug it will run alright but if i run it with start using debug it will give me error that cannot instantiate Active X control. What can be the problem please guide me
ThanX in advance
Regards
INAM
Inam
|
|
|
|
|
How do I declare a class used for utility that I do not have instantiate everytime I want to call a method from it. I have tried static this and void that, but can not seem to get it write. I know the prof mentioned it in a class I attended, but stupid me I did not write ti down.
thanks
rod
bigmansoftware.com
|
|
|
|