|
Hi again.
When any other window gets on top of a pictureBox, that region of the pictureBox becomes shaded (doesn't refresh) when closing that window on top. I've tried to use the Update() method in the Paint event, but it doesn't work.
How can I do this?
Thanks.
|
|
|
|
|
How do I play two sound files at the same time without one cutting out?
I can not do that with PlaySound API.
Please help me.
|
|
|
|
|
Just a thought but can it be done with the PlaySound API running on separate threads?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
I'm trying to get custom application icons but I can't seem to have a 16x16 AND a 32x32 application icon to load correctly. Basically I have a custom Application icon and a document icon. I am noticing the document icon is correct. Both on the application side and even in the Windows explorer side. Even when I change the Explorer view the icon changes size correctly. Now with the application icon, this isn't the case. This is the code I have in the resource file for my main window application.
IDR_MAINFRAMEGAMEMASTER ICON "res\\icon1.ico"
IDR_CGAMEONTYPE ICON "res\\calendar.ico"
IDR_MAINFRAME ICON "res\\CGameOn.ico"
icon1.ico is the 16x16 icon
calendar.ico is the document icon
CGameOn.ico is the 32x32 icon.
IDR_MAINFRAMEGAMEMASTER is the main frame I load when I set my configuration manager to "release". I also have a setting called "release -basic" in my configuration manager as well. I usually compile under the release therefore I am using the IDR_MAINFRAMEGAMEMASTER resource. The configuration above with the code I have will result in the application icon to be changed correctly as well as the explorer window to display the correct icon. But when I open the About box or change the explorer view to icons I get blanks. I'm not sure what is happening in why I get the document icon to work but not the application icon.
Any help would be appreciated.
Thanks!
|
|
|
|
|
Dear all,
In a C++ Windows Form application with several forms, and several generic C++ clases. I want to call the Main Form pointer or object form these other forms and classes, but do not know how...
As you can see, i'm very new to .NET!
Any help will be wellcomed, Thank you in advance!!
Eloy
|
|
|
|
|
Windows Forms does not use the MFC application model. I think you'd have to save your main Form somewhere. Alternatively you could enumerate Application.OpenForms, but again, figuring out the main form would involve traversing the parent-child hierarchy and all sorts of complexity. It'd be much easier to just save the main form in some static property that can be accessed throughout the app.
|
|
|
|
|
if your project or application is named "Foo" then the main form object is the Foo. Just add a static Foo^ class variable to your Foo class and initialize it in the constructor.
for example:
public ref class Foo: public System::Windows::Forms::Form
{
public:
static Foo^ myFoo;
Foo(void)
{
InitializeComponent();
myFoo = this;
...
}
...
};
Then, elsewhere in your code you can refer to your "main" form class as Foo::myFoo
hope this helps
|
|
|
|
|
Hi
Does any one know how to change the UserStrings Values in the .Net Metadata in code?
|
|
|
|
|
huh? explain what you're trying to do please.
|
|
|
|
|
Thanks for th reply.
Firstly I created resourcestrings in Delphi for .Net to keep Strings seperate in the assembly that is available to change with a resource editor.
These strings are saved in the .Net Metadata in the assembly under UserStrings.
I need to change these values inside the app, not with a external resource editor.
Delphi for .Net Code
resourcestring
StrPlay = 'Lets play'
C# code
const string StrPlay = 'Lets play'
This whole thing is to change the whole app between different languages on the fly. Form changes work 100% on the fly. The problem is the strings that is hard coded in the source files that needs to change between different languages.
Hope this explain it better. I can explain in futher detail. Any code examples in any language will help.
Thanks for helping!
|
|
|
|
|
1. you should never hard code strings in the source files if you want to be able to easily do localization and internationalization.
2. create a separate resourcestrings assembly file for each separate language, named appropriately (typically using the standard 2-letter designation for each language).
the naming convention is usually something like:
<assemblyname>.en.dll for english
<assemblyname>.de.dll for german
and so on where <assemblyname> is some resonable name
3. unload the current resource string assembly and load the one for the desired language
does this help?
|
|
|
|
|
Thanks.
Can you give me some example code that shows how to load and unload the resourcestrings dynamically in a app.
I read that resourcestrings load only at app start up according to locale and that you cannot change the resourcestrings dynamically.
|
|
|
|
|
I am using the System.Threading.Timer timer.
Now if I have a interval set quite low say 10ms it is possible for my timer event handler to be queued as they cannot be prcessed because the UI thread is busy or another application is running. When the UI thread becomes free it then processes all the queued events at the same time.
Is it possible to determine programmatically the number of timer event handlers that are being queued. I want to be able to determine when there is a build up of queued event handlers.
Some code to demonstrate this would be useful.
Also, is it possible to limit the number of timer event handlers that are queued?
Thanks,
Liam
|
|
|
|
|
The Timer your using doesn't use events at all, so what your asking is pointless. The Timer "Tick" calls your code directly using a seperate thread out of the thread pool for each "Tick".
But, if you were referring to the Forms-based Timer, that uses a Timer Tick event.
LiamD wrote: Is it possible to determine programmatically the number of timer event handlers that are being queued. I want to be able to determine when there is a build up of queued event handlers.
No. I think you're limited to Peeking at the next message in the message pump, without actually processing it. I don't think you can peek at the entire message queue. Also, this process would take longer than the 10ms you have between events.
LiamD wrote: Also, is it possible to limit the number of timer event handlers that are queued?
No, it's not. The best you can do to prevent a stack of tick events is to disable the timer at the beginning of your Tick event handler code, then reenable it at the end. This will, of course, throw off your 10ms pace, but your code will be executing the Tick event as fast as possible. 10ms is not alot of time to do much.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi every one,
I am trying to develop a windows application which will run on touch screen LCD monitor.
but the touch screen requires bigger option button,check boxes, tab pages, scroll bars etc. in such a way that the enduser select the controls using his finger.
How can i adapt the .net windows controls for the touch screen application (like changing size,graphics etc.,)?
or is there any special controls available for touch screen in .net?
or is there any tool available to convert the normal controls to touch screen controls??
Please help...
Thanks & Regards,
Srini
srini
|
|
|
|
|
Hi All,
I have a customised installer class inherited from System.Configuration.Install.Installer class.
Customised installer class again works as a base class for CustomInstallerExtended class which in turn is a base class for module wise installers as per my requirement.
Scenario is like this:
MyCustomInstaller inherits System.Configuration.Install.Installer
MyCustomInstallerExtended inherits MyCustomInstaller
InventoryInstaller inherits MyCustomInstallerExtended
I wanted some "custom action" before uninstallation of my inventory module. Say for example I want to execute some stored procedure before uninstallation.
In this case if a public overridable method say "OnBeforeUnInstallation" is given in MyCustomInstallerExtended class, which internally gets called on protected method "OnBeforeUnInstall" or any other relevant method given by windows installer, then the custom code can be written in the public overridden method "OnBeforeUnInstallation" in InventoryInstaller.
OnBeforeUnInstall method being a protected overridable method of windows installer class,it will not get fired in MyCustomInstallerExtended class.
AnyOne please help me out to know how OnBeforeUnInstall method can be used effectively to over come my problem statement or is there any other way out to solve the above mentioned problem?
HV
|
|
|
|
|
Hello!
I want to draw points and lines in a picturbox previously loaded with an image. (C#.NET 2k3)
I am trying to do something like drawing a red point where I click on the image. I do this, for example, in the MouseUp event, but nothing happens:
Graphics graph = Graphics.FromImage(pictureBoxHM.Image);
graph.DrawEllipse(new Pen(Color.Red),400,400,400,400);
pictureBoxHM.Update();
Any clues, please?
Thanx in advance!
-- modified at 20:03 Wednesday 4th January, 2006
|
|
|
|
|
It's amazing to me how many people continue to use a picture box when they move beyond what it's designed for. Why not just keep a bitmap in memory, and draw it yourself ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi there!
I'm developing an application with C#.NET 2003 and I want to use a web service I just created on the same computer to test it.
What I've done is to add the web reference (called "localhost" as default). Now I want to declare an instance of that service "localhost.Service1 s = new localhost.Service1();"
but the code preprocessor can't see it. When I try to compile it tells me a reference might be missing, but I actually added it.
I tried to create a new project, and it does add it correctly. Why in my application it doesn't? It's a windows form app.
Help, please!
NOTE: I just observed that localhost namespace is different! How can I change it????
-- modified at 12:55 Wednesday 4th January, 2006
|
|
|
|
|
Hello sergestusxx,
I think there is no problem in ur application. Only thing is make sure that how you are adding the web reference.
When you adding web service url in web reference dialog box, botton right corner there you have to mention the proxy namespace Name(suppose ttt), press OK.
go to your code there
ttt.Service1 s = new ttt.Service1();
regards
GV Ramana
|
|
|
|
|
Free Visual Basic.NET videos at http://www.vbdotnet.somee.com
please reply for any ideas or comments
|
|
|
|
|
HI, i've explained my problem earlier - http://codeproject.com/script/comments/forums.asp?forumid=1650&fr=26&select=1320834#xx1320834xx.
Here it's briefly. i have an assembly that is put there:
http://195.234.68.210/Test/index.html
http://195.234.68.210/Test/ImageEditor.dll
I add the code group to the "Runtime security policy" node in .Net configuration 1.1 applet
like it's discussed here:
http://www.developer.com/security/article.php/11580_3483866_1
But my applet still requests for the permissions: UIPermission, WebPermission
while it was already added.
This page will be given to many users - and i will probably need to give them deployment package or whatever. but still i can't tune this to fun on 1 pc
How should I trust this assembly?
Thanks for help.
I'm also ruzzled-duzzled. in the exception box it's shown PublicKeyToken=b77a5c561934e089 failed.
while sn -Tp ImageEditor.dll produces:
Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Public key is
0024000004800000940000000602000000240000525341310004000001000100931a11a77ea931
e6dbcc2747b1589b9c0e7076f915e3af354131e51ae6735d224d2cfcf43b67bdab7f3da769c8d4
aa6abfdb2ed78c2275167a021e6f33a59af01142404b5b98992db1dc2c3f2b93d68519c0e58af1
7cf586326c3449e93558348060b6152356c2215113940924fe2da127cbea5831657b6957b9757e
7f962bb9
Public key token is 3d6337e9d618e58d
|
|
|
|
|
Hi all:
I'm developing Smart phone demo project, but I encounter some problem as follow:
The compiler complains about the following code, for
" Error 1 error LNK2019: unresolved external symbol lstrlenA referenced in
function "wchar_t * __cdecl _com_util::ConvertStringToBSTR(char const
*)"
"
But I don't know how to fix it!
int COlog::CreateXml(char* strFileName, char* strTime, char* strRes)
{
char m_szPath[MAX_PATH];
MSXML::IXMLDOMElementPtr Root;
Root = m_pDoc->createElement("RunInfo");
m_pDoc->appendChild(Root);
MSXML::IXMLDOMElementPtr Res;
Res = m_pDoc->createElement("Result");
Root->appendChild(Res);
Res->Puttext(strRes);
MSXML::IXMLDOMElementPtr Time;
Time = m_pDoc->createElement("Begin");
Root->appendChild(Time);
Time->Puttext(strTime);
_snprintf( m_szPath, sizeof(m_szPath), "%s.XML", strFileName);
_variant_t varString = (m_szPath);
m_pDoc->save(_bstr_t(strFileName));
return 1;
}
|
|
|
|
|
Hi All,
From my system, I want to stop / start the IIS of different machine and that machine may be on different domain. I have written the following code, it works for my system and it does not work for othe system. It would be great help if you can give some idea.
private bool IISReset(bool start, string machineName)
{
string arguments = string.Empty;
if (start == true) arguments = machineName + " /start";
else arguments = machineName + " /stop";
try
{
//setting the password
System.Security.SecureString pw = new System.Security.SecureString();
char ch1 = 'm';
pw.AppendChar(ch1);
ch1 = 'd';
pw.AppendChar(ch1);
ch1 = 'm';
pw.AppendChar(ch1);
ch1 = 'f';
pw.AppendChar(ch1);
ch1 = 't';
pw.AppendChar(ch1);
ch1 = '@';
pw.AppendChar(ch1);
ch1 = '1';
pw.AppendChar(ch1);
ch1 = '2';
pw.AppendChar(ch1);
ch1 = '3';
pw.AppendChar(ch1);
string domain = "MyDomain";
Process process = Process.Start("iisreset", arguments, "maaz", pw, domain);
process.WaitForExit();
return true;
}
catch (System.Exception ex)
{
return false;
}
}
Vishal Modi
|
|
|
|
|
How can you stop other machine's IIS? This is not possible unless until you are able to run this code on the desired machine.
|
|
|
|