|
I've already spent 3 weeks trying to find a suitable solution, including every article I can find on the platform SDK... but, like I said, most every solution is in c++ and would be extremely difficult to port to c# or vb because of the MFC underworkings and abilities c++ has to do things like creating co-classes. The reason I'm pursuing it at this point is that the project itself is done (shy of marketing) and this is the last step. You're right, it won't impeed functionality, but I also wouldn't drive a car withouth a front windshield if I had a choice
|
|
|
|
|
If you can't or don't want to interop and P/Invoke all that's required in C#, you're forgetting a good alternative: write a mixed-mode Managed C++ assembly and port your drag-n-drop code to that. Using a mixed-mode (as opposed to pure; the difference being what APIs you use) assembly gives you full access to unmanaged and managed APIs.
What do you want me to tell you? As I said, it's a complex problem to solve and I'm a very busy person. I'll get around to an article when I can, and I haven't seen a decent one regarding this.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Alright - One more question then I'm putting this issue on the back burner for a while...
I scoured the net last night and finally found (after translating a site from German to English) an ATL component that provides the shell dragimage support I'm looking for. The test project is in VB6 and works fine as long as the target control has its DragMode property set to Manual (1). Then I referenced the ATL dll in a new windows forms project and ported all 3 lines in VB to c# (also tried vb.net). I'm sure you'll be shocked that it didn't work. I did set the AllowDrop property of the form (also tried other controls) to true, and I also tried setting the drageffect manually in the dragenter and dragover events, and still no dice. I'm sure there's something very basic I'm missing here, and if I can get over this hurdle I'm home free. Any thoughts on the way a VB6 control handles dragging vs a .net control?
Thanks!
|
|
|
|
|
Anything that'll work in VB6 will work in .NET (doesn't matter if you use C# or VB.NET - it all compiles to IL and you only need class library support for this, which all manages languages can access). That doesn't always mean it's as easy (since the VB VM hides the automation details).
First, make sure you've registered your ATL server you found and create an interop assembly from it (using either tlbimp.exe or have VS.NET create it - it all works the same). Make sure that is referenced by your project. This is the RCW (Runtime Callable Wrapper) that you need.
As far as how to use it, I really can't help you there, especially since I have no idea of what project you're talking about (a link would've helped).
Finally, don't assume that types in .NET translate to types used by the ATL component. For example, the DragDropEffects may not have the same values as what the ATL component is expecting, just like the IDataObject interfaces are not the same between .NET and the Shell APIs (though they are transformed internally at a point).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Here's the english version:
http://www.glimt.dk/code/clipx.zip
Register the altBind.dll and run clipx.exe. You can drag a object from Explorer to the "Clip/Drop" button. All the VB source is included.
|
|
|
|
|
does anyone know how to enable visual styles in the webbrowser control? is it even possible?
thanks,
einar
|
|
|
|
|
Is your application including a manifest to bind to version 6 of Comctl32.dll? If you are using .NET 1.1 you can call Application.EnableVisualStyles(); .
- Nick Parker My Blog | My Articles
|
|
|
|
|
i'm using 1.1 yeah, but Application.EnableVisualStyles(); doesn't seem to work for the browser control.
|
|
|
|
|
This has been a common problem, usually fixed by calling Application.DoEvents after calling Application.EnableVisualStyles , and calling both before instantiating a single Control (usually before calling Application.Run ).
For example:
public class AppForm : Form
{
static void Main()
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new AppFrm());
}
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i tried that before but didn't have any luck.
this is for EnableVisualStyles() from the msdn docs: "Note This call will have no effect for controls in the browser."
i guess i'll have to wait for whidbey :/
|
|
|
|
|
If you have control over the HTML, include the following meta element within your pages:
<meta http-equiv="MSThemeCompatible" content="yes"/>
- Nick Parker My Blog | My Articles
|
|
|
|
|
doesn't work either.
when set to "no", that meta tag doesn't seem to have any effect whatsoever even in a regular ie session
|
|
|
|
|
Read Using Windows XP Visual Styles[^] on MSDN and go to the "Using Visual Styles with HTML Content" section. See if any of the rules they specify are being broken by your HTML to improperly render the visual style.
- Nick Parker My Blog | My Articles
|
|
|
|
|
this should theoretically be possible according to the docs, don't understand why it's not working.
anyway, i'll look into it some more one day. thanks for all the tips.
|
|
|
|
|
hello guys,
I was wondering if its possible to load Form into a Panel that is located on a main Form??
I am in the process of creating an application that have multiple views that for now have 20+ Panels. But its getting out of hand as its impossible to get a view of them all. Therefor i was wondering if its posible to create forms to be placed into another form - either inside a panel or some other means?
any sugestions and code examples would be welcome.
|
|
|
|
|
No, it's not possible. Use MDI instead.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hey Heath,
Not sure if you check out the ASP.NET board at all, but I'd really appreciate your take on a question I threw up there, considering you've basically committed the .NET framework to memory and all...
Jeremy Kimball
I have traveled the gutters, lo these many days, with no signs of life. Well met.
-brianwelsch
|
|
|
|
|
I try to steer clear - there's far too many questions about client-side stuff, and the majority of people just don't understand what ASP.NET is. I typically spend more time explaining why you can't popup a window using pure ASP.NET than anything.
I'll check it out, though.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
I typically spend more time explaining why you can't popup a window using pure ASP.NET than anything.
You've got to be kidding me...
Heath Stewart wrote:
I'll check it out, though.
And that is why "You Da Man"...thanks
Jeremy Kimball
I have traveled the gutters, lo these many days, with no signs of life. Well met.
-brianwelsch
|
|
|
|
|
Urgh.
Ok thanks for the fast reply.
Btw. is there anyway using MDI forms to remove the borders, and then show the form in full size so its not possible to see that its MDI?
I have only played around with alittle so its only a thought before i look closely at it.
cheers
|
|
|
|
|
Not easily, no. For that you really have to understand the Windows messaging system, styles, P/Invoke in .NET to use all that, and dialog resources in Win32.
I would suggest re-designing your controls. You could, for example, use a UserControl or some other Control derivative and just dock it (using DockStyle.Fill ). If the UI and implementation is already in a form, then abstract them to a UserCotrol (or something) and use that in both forms.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi all,
I'd just like the souce code to get a timestamp from a terminal.
example program:
standard form, with a command button on it. When you click the button, it gets the time from the terminal and displays it on the form!
I just need the code behind the button
Thanx 4 your help
|
|
|
|
|
Stuggo wrote:
gets the time from the terminal
What do you mean by "terminal"?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Hi people, hope you can help me.
I have the following code
public class TestDS : System.Data.DataSet
{
}
public class DataSupplier : dalBase
{
public DataSet GetSupplierList()
{
HybridDictionary parms = new HybridDictionary();
return Factory.GetDataSet("GetSupplierList", parms);
}
public TestDS GetSupplierList()
{
HybridDictionary parms = new HybridDictionary();
return (TestDS)Factory.GetDataSet("GetSupplierList", parms);
}
}
The first method works fine and returns a normal dataset. However, I need to create a strongly typed dataset hence the casting in the 2nd method to my own subclassed dataset. Trouble is when I run this I get a the dreaded 'Specified cast is not valid' error.
I was sure that I should be able to do this but it just doesn't work. Any ideas anyone?
Cheers
Paul
|
|
|
|
|
First, it is not CLS-compliant to have more than one method with the same name that differs only by the return type. Instead, rename one or both of your methods, such as GetTestSupplierList or something more suitable.
Second, your DataAdapter (or however you're filling your TestDS ) should actually fill an instance of that TestDS class. So, perhaps add a Type parameter to your Factory.GetDataSet method, something like this:
public static DataSet GetDataSet(string storedProc, IDictionary parms, Type dsType)
{
if (dsType != typeof(DataSet) || dsType.BaseType != typeof(DataSet))
throw new ArgumentException("Not a valid DataSet type.", "dsType");
DataSet ds = (DataSet)Activator.CreateInstance(dsType);
} You should be able to cast it, since the return of GetDataSet still returns a DataSet . Such a method works fine in our enterprise application.
Microsoft MVP, Visual C#
My Articles
|
|
|
|