|
|
Thanks, it works fine except for now when I hit enter in the richtextbox, it will make a new line. I can't input any other letter or anything, enter is the only thing that changes richtextbox... I'm sure I'll figure out how to stop it sooner or later, but do you know why it does this?
|
|
|
|
|
i have a c# program where i run perfectly no problem under win2000.
however, the problem occur when i try to run in win98 installed with
.NET Framework 1.0.3705.
(1)i try to hide the main form and display the system tray icon when
user click on minimize button. i put the following code in main form
constructor:
------------------------------------------------------------
this.Resize += new System.EventHandler(this.frmMain_Resize);
this.notifyIcon1.DoubleClick += new
System.EventHandler(this.notifyIcon1_Click);
------------------------------------------------------------
the function of frmMain_Resize look like:
-----------------------------------------
private void frmMain_Resize(object sender, System.EventArgs e)
{
if( this.WindowState == FormWindowState.Minimized )
this.Visible = false;
}
-----------------------------------------
the function of notifyIcon1_Click look like:
-----------------------------------------
private void notifyIcon1_Click(object sender, System.EventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.Activate();
}
-----------------------------------------
when i click minimize button of the main form, main form hide and the
system tray icon display. i double click the system tray icon and the
main form show up again. then when i click on minimize button again,
nothing happen.
i realize the frmMain_Resize wont be execute. this problem only happen
when i run this application in win98. win2000 work perfectly.
(2) please refer http://www.geocities.com/yccheok/net/prob.html for
screen shoot.
i try to display a modeless dialog with code
--------------------------------------------
if(frmViewLive.IsDisposed)
{
frmViewLive = new FrmViewLive(this);
this.AddOwnedForm(frmViewLive);
frmViewLive.Show();
frmViewLive.Activate();
}
else
{
this.AddOwnedForm(frmViewLive);
frmViewLive.Show();
frmViewLive.Activate();
}
--------------------------------------------
although i click on the close button of the frmViewLive, the task bar
still displayed its "Live Image" title. when only i click on the "Live
Image" task bar, only will the task bar disappear. this is strange coz
win2000 has no this kind of problem.
may i noe how can i solve this problem? thank you.
regards
yccheok
|
|
|
|
|
1) The message you want to catch is not normally exposed by .Net. Clicking on the minimize button, or by using shortcut keys, etc., sends a WM_SYSCOMMAND message to the form's window, along with a command value of SC_MINIMIZE. There is a way to capture these messages, however, so you can really polish your app.
In your app's constructor, add:
this.SetStyle(ControlStyles.EnableNotifyMessage, true);
That will allow you to override the OnNotifyMessage() function, which catches all window messages. So add to your app's methods:
protected override void OnNotifyMessage(Message msg) {<br />
<br />
if (msg.Msg == 0x0112 &&
(uint)msg.WParam == 0xF020) {
<br />
MessageBox.Show("Minimize activated");<br />
}<br />
}
I'm fairly sure that no matter what platform you run on, the message box will fire on any minimise event. That includes minimising from the taskbar, or any other means. Of course, you'll want to replace the message box with your form-hiding code. No other event will falsely trigger minimising either.
Cheers
|
|
|
|
|
thanks n i will try it out 2night. but can u tell me why
this.Resize += new System.EventHandler(this.frmMain_Resize);
won't work in win98?
thank you.
regards
yccheok
|
|
|
|
|
yccheok wrote:
won't work in win98?
You can't run .NET applications on Windows 98.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
Nick Parker wrote:
You can't run .NET applications on Windows 98.
Sure you can, its Windows 95 that isn't supported
James
- out of order -
|
|
|
|
|
James T. Johnson wrote:
Sure you can, its Windows 95 that isn't supported
Oooppps, I was thinking of the .NET Framework SDK requirements.[^]. Thanks James, I think it time for me to go to bed now.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
Honestly, I'm not sure, although I do know that there were some changes in message handling, that started with W2K. I was only thinking in terms of giving you a better solution to your problem, and had not looked into the cause of your difficulties.
A simple way to find out, would be to temporarily add logging to app (or add a textbox), and list every message received in your new handler. Then just compare the list of events triggered after clicking the minimise button in W98 and W2K. You could do the same thing with Spy++ too.
One of the frustrations I have with .Net, is that I can't see how things work like is possible with MFC/ATL/WTL. So the answers aren't always obvious.
Cheers
|
|
|
|
|
The following doesn't seem to work:
set o = CreateObject("TestNamespace.Test")
After compiling Test.dll and running regasm Test.dll. I've also tried regasm /tlb Test.dll.
The error I'm getting is "ActiveX object can't create component TestNamespace.Test".
It does work if I place the dll in the gac. Shouldn't vbscript look for the dll in the current directory? What should I be doing to get this to work without using the gac?
|
|
|
|
|
Use the /codebase parameter to regasm (btw the /tlb option is actually /tlb:filename ).
The /codebase option gives you functionality you are used to with regular COM server dlls in that you don't need to know where the server is located for it to work.
James
- out of order -
|
|
|
|
|
Ok that does seem to work. Appreciate it. But why doesn't it just look in the current directory? Kind of odd that it would need the codebase tag.
|
|
|
|
|
It *should* work with it in the build directory. But if I remember correctly when you run the program from within the VB6 IDE you aren't actually running your exe in the build directory. You are running something from within the VB6 program directory.
I don't have VB6 installed anymore so I can't verify this; but it jives with everything I remember.
James
- out of order -
|
|
|
|
|
Well I don't see why it doesn't just *always* look in the current directory for the dll even if you are running a vb6 exe (I did copy the dll to the vb6 build dir). Just doesn't make sense why you would need a static codebase.
|
|
|
|
|
grv575 wrote:
Well I don't see why it doesn't just *always* look in the current directory for the dll even if you are running a vb6 exe (I did copy the dll to the vb6 build dir).
It uses the same loading scheme that the framework uses when it goes to load a .NET assembly. Going from memory this means: Look in the GAC, look in the same directory as the executable, and finally look in the probing directories as specified in the configuration file (by default this is set to "bin\").
Using my current project (a C++ program using a custom .NET assembly via the CCW) as an example.
Test.exe -> C++ program
Managed.dll -> .NET assembly
Run regasm with /codebase on Managed.dll and I can place Test.exe in any directory with or without Managed.dll and it will run.
Run regasm without /codebase (after first /unregistering it). Now Managed.dll must reside in the same directory as Test.exe, but I can run Test.exe from any directory (ie place both in \test\ run from the commandline in \).
If you check out this thread[^] there are some comments about how loading works when using CCW'd components.
James
- out of order -
|
|
|
|
|
Cool, the /unregister tip did the trick. Guess I overlooked that.
|
|
|
|
|
Hi,
I am working with Task Scheduler, which in order to work correctly under XP needs to have a valid username and password in the Run As settings.
Under XP, its possible to have accounts that do not have passwords assigned. So task scheduler will never run, even with a blank password.
I've looked at WindowsIdentity, which works great to obtain the account name, but nothing further to authenticate or look at attributes of the account.
Does anyone know how I can detect whether an account has been assigned a password? And if it hasnt, how I can provide a link to have the user set
a password?
Ingram Leedy
You can't depend on your eyes when your imagination is out of focus.
--Mark Twain
|
|
|
|
|
I'm having trouble trying to access the different colour depths and sizes in an icon. Does anybody know how to load an icon into memory and pull the correct image depending on the system colour depth and users size selection?
I'm trying to provide different icons for disabled users but the imagelist will only hold one size and depth and the class is the same!
Help
|
|
|
|
|
So I have this datagrid in a web user control. The grid has some basic link buttons for functionality like Edit, Add, Update and Cancel. They all work fine when the user control is put on a web page.
I came across a need to have this datagrid repeat with some other information so I put the user control in a datalist. Now only the Edit and Add buttons work. I set some breakpoints, and it looks like any of the buttons located in the grid's EditItemTemplate will not fire their grid events. I set up some events and breakpoints in the datalist as well to see if the events were bubbling up somehow, but they weren't.
When I click on the Update or Cancel link buttons the grid reverts back to EditItemIndex equal to -1 or at least the edit line is going back to the regular ItemTemplate. I set breakpoints everyplace I was setting the grid's EditItemIndex, and again no dice.
Has anybody run into this problem? Anybody figure out a solution?
|
|
|
|
|
How can I protect the MSIL code?
I've seen that Anakrino can convert MSIL code to C# code very easy.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
|
leppie wrote:
Nice! Isnt it?
It's damn nice I can convert others code!
But I don't want others to convert my code! ;P
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
|
Demeanor for .NET scared me:
Demeanor for .NET Enterprise Edition is available now for US$ 1,250 per license
Couldn't you come with something cheaper?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
Couldn't you come with something cheaper?
Sure you could check this out:.Net IL-Obfuscator[^]. I believe they have a free trial and their product purchase price is a lot more reasonable. Here is another if you are still looking:Salamander .NET obfuscator[^].
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|