|
I created a simple user control in C# which has a button in it.
//DemoControl.cs
namespace DemoControl
{
public class UserControl1 : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Button button1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public UserControl1()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitComponent call
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
components.Dispose();
}
base.Dispose( disposing );
}
#region Component Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(16, 16);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(88, 32);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// UserControl1
//
this.Controls.Add(this.button1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(608, 248);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.UserControl1_MouseMove);
this.ResumeLayout(false);
}
#endregion
}
}
The i created an MFC ActiveX control to host the C# control
//HostCtrol.cpp
int CMfcHostCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
AfxEnableControlContainer();
DemoControl::UserControl1* pcal = new DemoControl::UserControl1();
CComPtr<iunknown> spunkControl;
spunkControl.Attach((IUnknown*)System::Runtime::InteropServices::Marshal::GetIUnknownForObject(pcal).ToPointer());
CRect rectPlaceHolder;
GetClientRect( &rectPlaceHolder );
m_ctrl.Create(spunkControl, WS_VISIBLE | WS_TABSTOP, rectPlaceHolder, this, 0);
return 0;
}
where m_ctrl is CWinFormsControlWnd class which i downloaded from the MSDN Magazine at http://msdn.microsoft.com/msdnmag/issues/03/03/WindowsForms/default.aspx
It works great, but the hosting application stuck when i press the button.
Does anyone knwos whats wrong?
Amir.
Amir Harel
|
|
|
|
|
Hiya I have a script that I want run when installing my app. This scripts adds my database table.
How do I do this??
Thanks.
|
|
|
|
|
Hi All
Ive written a portal mobile portal in vb.net that I want to secure to only authenticated users. I am having great difficulty doing this, as when I test in the nokia wap simulator 4.0 (most of the users will have nokia browsers) I cant seem to store any state.
When I authenticate the user, NMB 4.0 doesnt reflect the persisted information. THe web config file is set to not use cookies and the state is persisted if I test it with a an actual nokia 6230(GPRS), the open wave simulator and also normal IE browser. Any Help is appreciated.
(details of the authentication Im using is below):
Dim username As String = "RyanMalone"
FormsAuthentication.Initialize()
Dim strRole As String = AssignRoles(username)
'The AddMinutes determines how long the user will be logged in after leaving
'the site if he doesn't log off.
Dim fat As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, _
username.ToString, DateTime.Now, _
DateTime.Now.AddMinutes(1), False, strRole, _
FormsAuthentication.FormsCookiePath)
Response.Cookies.Add(New HttpCookie(FormsAuthentication.FormsCookieName, _
FormsAuthentication.Encrypt(fat)))
Session("Telco") = "Optus"
|
|
|
|
|
Hello people,
My company has a set of COM components that all have the same interface, so we use CATID's to allow the user to select which component to use.
I have succesfully wrapped one of our components ina .NET wrapper using the MS tools, and it works fine from C# etc. However, I cannot find a .NET equivilent of the CATID mechanism to categorise a set of comnponents with the same I/F.
Can anyone point me in the right direction? I know there is a recent article of actually using CATID in .NET, but I was wondering what the .NET systme would use natively.
TIA
JamesH
|
|
|
|
|
Hi!,
i hava a problem with a web service: the client signs an xml document using infopath and sends it to the server. I try to verify ir using checksignature method but always returns false!!!!!!!!
maybe the error is that i sign the document with infopath.
please help!
|
|
|
|
|
how come i cant override the public virtual method 'Clear()' of the System.Collections.CollectionBase class?
when im trying to override it im getting that error:
"C:\Documents and Settings\Roy\My Documents\Visual Studio Projects\WebEngine\Class1.cs(49): 'Goblineye.Projects.WebEngine.EditorCollection.Clear()' : cannot override inherited member 'System.Collections.CollectionBase.Clear()' because it is not marked virtual, abstract, or override"
however, the method does declared as virtual...
here's the method declaration (provided by MSDN):
public virtual void Clear();
You can spot it right here:
CollectionBase's Clear() Method
i would be grateful for any help.
|
|
|
|
|
At the bottom of the page is a link to tell microsoft about it. If your mail client supports it then the link will open a new email with the subject line appropriately populated. Write your comments in the body of the email.
If you want to override the behaviour of the Clear() method then I suggest you override OnClear() [which is called before Clear() ] and/or OnClearComplete() [which is called after Clear() ] instead.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
I'm working on writing a custom menubar/toolbar set of classes, to replace the standard windows menu bar in my applications. I would like to have a fully custom-drawn, pure C#/.NET coded paint method to draw the popup menus for the menubar. I've run into the little problem of needing the screen DC to be able to properly draw the popup menu outside the bounds of the menubar control, though.
Is there any way to get the screen DC using GDI+, so I could draw to it as if it were a standard windows control? I remember being able to do this long ago before the days of MFC, but I havn't tried since. I havn't had much luck finding any documentation on how in the MSDN help, nor by browsing around the articles here on CP.
Any help is greatly appreciated...
|
|
|
|
|
Try calling GetDC using WIN32 interop.
Like this:
Step 1. int hdc = GetDC (0) // Gets the screen DC
Step 2. Get a graphics object from the DC and draw
Step 3. Dispose the graphics object and call releaseDC like this
ReleaseDC (hdc, 0)
Thanks
Shafqat Ahmed
admin@shiplu.com
|
|
|
|
|
Thanks for the reply. I assume the GetDC() function is in gdi32.dll? I use C#, not C++, so I have to DllImport it to use it.
|
|
|
|
|
hi there
i am trying to connect dataset true crystal reportos in visual dot net framework 2003
when i am defining the reporot every thing is o.k
but when i am trying to see the report in the Form
i have a problem
before the report is up i am geeting a login Form
its called database login
Server name :
DataBase :
LogIn ID :
Password :
what do i need to write in this Form & i dont want this Form every time that i want to see the report
how can i pass it or put it in code ??
i am on c# my Db is Oledb (Accses)
thanks ....
|
|
|
|
|
Hi All
I am trying to build a Debug version of Win32 DLL under Dot Net 2003 . I link to a Release version of Win32 DLL not using MFC built under the Visal Studio 6.0 ,
I always get the above mentioned error with Unresolved external symbols.
Anyway, I can fix it.
I can build release version successfully.
Thanks
Sankar
|
|
|
|
|
Hi all
I'm building a C# application to run on a PocketPC. What I want to do is be notified when the device is docked. This way I can connect to our server and refresh some internal information. The info doesn't live on the desktop machine, so it has to be retrieved via a TCP connection.
I've had a good look through the MSDN examples, and I'm feeling a little lost and confused. It speaks about a function called CeRunAppAtEvent which appears to be precisely what I want. But I don't know how to get this running successfully in the C# app.
Any help or even pointers would be greatly appreciated.
Thanks in advance
Andre
|
|
|
|
|
hi all... i need help... here's my problem.. i need to open internet explorer in .net cf so that it will link to some page.. unfortunately .net cf dosent' support this function (System.Diagnostics.Process.Start("http://www.google.com/")..
i've searched far and wide for and answer and here's the nearest solution i found..
http://www.dotnet247.com/247reference/msgs/18/93902.aspx
he has a simmiliar problem with me and he solved it using some code there .. which i don't really understand cause i'm a junior programmer.. anyone kind enuf to plz test the code for me and do a sample working program for me plz?
send it to chrisleong18@yahoo.com ok?
thanks in advance... i really need to do this.. help ...
prozio
|
|
|
|
|
Hi,
Can anyone plz tell the fix for following problem !!
I'm getting an error while opening a report thru .net,
it says "Fail to render the page".
The error i'm getting is only for the first page.
Second page is displayed properly !!
The report runs nicely with Crystal Report s/w.
Plz do tell the fix ... It's urgent
Thanks in anticipation
|
|
|
|
|
Hi, everybody,
Rightnow, I installed my Visual Studio .NET 2002 in my pc running Windows XP with .NET framework 1.0.
My question is : If I download .NET Framework 1.1 and install it on my pc, does my vs 2002 use the new framework 1.1? If yes, how can I check it?
Thanks in advance!!
Alan Shen
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
For every version of the .net framework, Microsoft releases a new version of vs.net.
- Visual Studio.NET 2002 -> .NET framework 1.0
- Visual Studio.NET 2003 -> .NET framework 1.1
- Visual Studio.NET 2005 -> .NET framework 2.0
To answer your question: You can't use an older version of visual studio to work with a newer version of the framework.
|
|
|
|
|
ZippyV wrote:
For every version of the .net framework, Microsoft releases a new version of vs.net.
I think a more accurate statement would be:
So far for every version of the .net framework, Microsoft releases a new version of vs.net
This may or may not continue to be true.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Hi All,
I have data (files and folders) into sql2000 and want to display into windows explorer as drive(virtual drive).
if anybody have already done this type of work. please let me know asap.
Thanks & Regads,
Dinesh
Dinesh Chandra Porwal
Sr.Software Engineer
|
|
|
|
|
Hello,
Does anybody in this forum have experiences with the Smart Device Framework of the OpenNETCF.org??
Regards.
mathon
|
|
|
|
|
|
Serialization is the ability to save and load object state in the form of a series of bytes (not necessarily XML).
my blog
|
|
|
|
|
Sir,
Here Our Country and Language (Myanmar Burmese) is not supported microsoft window or any other OS. We have our own language, character, text, sort order, compare method and so on. But I, an idiot, have no idea to build an localized application without any OS sited NLS or something else. I want to know how to build .NET localized application for non OS national language support for our language EXACTLY.
We have our own font, unicode space, and ... HELP ME.
KZYH
|
|
|
|
|
Hi Kyaw Zayar Han,
you can use some classes in System.Globalization namespace. It's quite late night and i am gonna wake up early in the morning, so I will write u more later... Bt only in case u didn't already solve it! this post is quite old so maybe it's all done now.
best regards,
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hello David,
I am so glad to hear from you about my problem. Yes I have ever seen the classes of System.Globalization at rotor of www.123aspx.com. I assumed that I have to create a satellite assembly class which includes some resources such as sorting table. Yet I don't know how to build the sorting table. It is sure that I haven't still solved the problem. Do you know it is so shameable to say that our country haven't still solved mother language problem for microsoft platform yet, even though we are taking some outsourcing and our developers have worked around the world.
Anyway, I feel compelled to know about your experiences and can't bear to wait learning from you. It'd been a long to wait to get response like yours. I thanks god and you for this.
Best Regards,
Kyaw Zayar Han
KZYH
|
|
|
|