473,413 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Different window class

Hello world! 8-]

I'm trying to create a form that will have different window class. I have
overridden the CreateParams property of a form as follows:
~
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams

Get

Dim tempCP As CreateParams = MyBase.CreateParams

tempCP.ClassName = "PlaySmth.Class"

Return tempCP

End Get

End Property

~

.... but I'm getting System.ComponentModel.Win32Exception.

I think I have to register this new window class, but I can't do this
without original class info. But

~

Dim WC as WNDCLASS

GetClassInfo(0, Old_Class_Name, WC)

~

failed.

So, does anyone know how to get info on old window class, or, maybe, a
different way to change class of a window being created?

Thanks in advance.

Dragon

Nov 21 '05 #1
2 1048
>I think I have to register this new window class, but I can't do this
without original class info. But

~

Dim WC as WNDCLASS

GetClassInfo(0, Old_Class_Name, WC)

~

failed.

Failed in what way?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 21 '05 #2
> Failed in what way?

I mean, GetClassInfo returned 0, and there were no changes in the WC
structure.
Marshal.GetLastWin32Error gave me 87.

I suspect the trouble is with first GetClassInfo parameter. I assumed that
old class was created by OS, but it seems that it wasn't. Unfortunately, I
have no idea what should I substitute for hInstance.

Any suggestions?
Nov 21 '05 #3

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

Similar topics

2
by: Dave | last post by:
I'm getting different results when I display a value in the Output window as opposed to the Immediate window. Why? Code to recreate problem: 'Purpose: Get different results from Output...
4
by: troloo | last post by:
Hello, I hope you can help me :)) The story goes as follows: I have a class with different methods and member variables. I store pointers to objects of this class inside a vector. Now, I would like...
2
by: Greg Merideth | last post by:
Using Visual C# I created two forms such as namespace test { public class SystemTray : System.Windows.Forms.Form { public createwindow() { stuff here; } public fadewindow() { stuff to fade...
1
by: cnickl | last post by:
I have a coding problem. I hope I can explain it well enough. I’m using VC++.NET, managed window forms I want a dialog window change some process going on controlled by a class defined in my...
9
by: PCI | last post by:
A Thread is created on form1 that addresses a sub in another class. When attempting to invoke and sub on the main form I recieve an error about a Window Handler needing to be created first. Is...
3
by: Neo | last post by:
I am going to make SDI base application in MFC, which has a button for "New Window", will show new window with different view. How I can solve this problem? Main window view class inherited...
26
by: Cliff Williams | last post by:
Can someone explain the pros/cons of these different ways of creating a class? // 1 function myclass() { this.foo1 = function() {...} } // 2a
3
by: patrickst1 | last post by:
Ok, so I am really and truly a beginner at C#. I have been programming for some time but just beginning to learn this language. Here is what I am trying to accomplish. I have created a little...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.