|
You have clients ? Rentacoder ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
why, very challenging nai?. Yes he is our client, very circastically intelligent client.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: why, very challenging nai?.
Not sure what this means ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I've recently posted an article here about my C# SynthToolkit[^]. This toolkit is for creating "softsynths" in C# (or any .NET language).
I'm pleased with the toolkit except for one thing: The output occassionally glitches. I will be playing a synthesizer created with the toolkit and everything will be fine. But then it suddenly begins to glitch. The sound is almost like static.
The problem isn't with the synth engine. I've recorded the output to a wave file when this has happened, and the glitching doesn't show up. I believe the problem is somehow in the interaction between Managed DirectX and Windows Forms. The glitching begins somtetimes when the focus changes from one Form to another. The environment in which the synth is run is an MDI application. If I click on, say, a button on one Form when another previously had the focus, the focus changes to the new Form (goes without saying). A small percentage of the time, this causes the sound to begin glitching. It's strange because if I move a window around or click on another window, it sometimes stops and playback continues normally.
My conclusion is that changing focus somehow interferes with the performance of either the SecondaryBuffer I'm feeding wave data to or the waveform output Device responsible for playing the waveform data. When I use a Device object, I have to call its SetCooperation method, passing it a Form. I simply pass the Form in which the Device was created. So somehow in the background I'm assuming there's some kind of interaction between the Device and Form.
Any thoughts or ideas on a possible solution will be welcome.
The only thing I can think of now is hooking into the focus event of each Form in my application and doing something in response like stopping and restarting playback in hopes of clearing whatever problem is occuring.
|
|
|
|
|
Hi friends ,
i have a requirement as follows..
i have a checkbox when i clicked it a form should be opened which will contain a label , a textbox and buttons like OK and cancel..
for this purpose i am using the Interaction.inputbox()...
now i have will do something on parent form(checkbox form ) when user click ok and cancel on Interaction.inputbox()...
my question is how to capture that user clicks ok or cancel???
if any body can give other solution without using interaction .. welcome to that also..
please helpme out as earlya as possible
Regards,
Phani
|
|
|
|
|
You should set the button's DialogResult to DialogResult.OK or .Cancel for the OK and the
Cancel button. Then:
If you show a form as a dialog (i.e. with ShowDialog()) then click
any button it will return the button's DialogResult; and
if you click the dialog's Close Box, it by default return DialogResult.Cancel.
furthermore:
- you can set the Form.AcceptButton to interpret the ENTER key as an OK
- you can set the Form.CancelButton to interpret the ESCAPEkey as a Cancel.
-- modified at 11:19 Wednesday 25th July, 2007
|
|
|
|
|
but there is no form.showdialog() intaerction is the microsoft class
so only method inputbox() i can use
so consider this issue....
|
|
|
|
|
Interaction.InputBox returns when it is done
If the user clicks Cancel, a zero-length string is returned, otherwise the actual input.
That tells it all, doesnt it ?
|
|
|
|
|
yes but suppose user does not want to enter the reason i mean reason is optional
then if user click ok then the string is blank right?/
how to differentiate in this case when user want to enter a bank reason and clicks ok
|
|
|
|
|
You can set DefaultResponse to something, it will be returned when the user does not
enter anything but clicks OK; I guess it will also show as the initial value.
Examples:
- "Please specify reason"
- "?"
- " "
each of these will be erased on cancel, and possibly modified and returned on OK
If that does not suit you, write your own form !
|
|
|
|
|
Hello,
I'm using the webbrowser in my litle email client. I'm editing the message in the browser, then accessing it over DocumentText and sending later.
Does anyone know how to change webbrowser's encoding from code?I tried:
webbrowser.Document.Encoding = "windows-1250";
and actually it puts the correct encoding into the html code, but it deletes all the special characters in the html.So I will get:
<META http-equiv=Content-Type content="text/html; charset=windows-1250">
which is correct but eg. for this
Čeština je krásná
I get just:
<br />
<p>etina je krsn</p><br />
This happens when I'm changing the encoding after the editing of the document is finished. I tried to first change it to windows-1250 and then edit the content, but actually every time I edit something in webbrowser it changes back to utf-8, which is default I suppose.
Any help on this appriciated
Thanks
Honga
|
|
|
|
|
Hi!
I have the following situation:
A panel called "BayContainer" some custom-controls from type "Bay" should be filled by file-drag&drop.
So i created a method called "insert", that gets the position, the filename and the "BayContainer.Controls"-Object, where the newly created custom-control should be placed, as parameters
When dropping a file into the panel the position is being calculated, the control is created, size and position are set. The first file works fine, but the 2nd control is not being painted (allthough it seems to be there because it received events, that are being connected to the new control).
Any ideas, why the 2nd, 3rd, etc... control do not appear inside the panel?
Thanx for help!
J.
|
|
|
|
|
Hi,
I would like to know one thing. On installation some applications restart
the machine and automatically run some dlls on system reboot. But this dll
will not run on every reboot. It runs only on this application installation
process.
Can this be done in C#? Any one please put some light on this...
Thanks in advance:
Rakesh
Rakesh
|
|
|
|
|
dlls cannot be run, without a host program to run them. To run an app on reboot, put an entry in the 'runonce' key in the registry.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks a lot for the Idea. This runonce concept definetly solves my purpose.
But I am facing some issue here. I have placed a string value "E:\test\runtoadd.bat". And this batch file consists of a command which runs a registry file which inturn resets a registry key.
Then I reboot my machine and observed that the batch file and .reg are running on the reboot but the the thing is the registry key is not getting effected. Can you please let me know what is mistake here.
Thanks:
Rakesh
Rakesh
|
|
|
|
|
perhaps your batch file does not have permission to make the change ? What if yuo run it from the command line, does it change then ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes. When I run from the command prompt it changes...
Rakesh
|
|
|
|
|
As Christian says it may be a permissions problem, which registry key are you trying to change ?
|
|
|
|
|
Greetings all,
I can drag and drop a bitmap from a small picture box (pictureBox1) to a larger picture box (pictureBox2) and it works fine until a repaint, at which point the large picture box reverts back to what it was before the drag and drop. Thank you in advance. Any ideas to fix this would be appreciated. (Thanks to Rehan Nadeem for the Win32Support code!)
private void pictureBox2_DragDrop(object sender, DragEventArgs e)
{
if ((e.Data.GetDataPresent(DataFormats.Bitmap)))
{
Point largeBitmapLocation = this.pictureBox2.PointToClient(new Point(e.X, e.Y));
// 1. Get a handle to the large bitmap device context
Graphics largeBitmapDC = this.pictureBox2.CreateGraphics();
IntPtr largeBitmapHdc = largeBitmapDC.GetHdc();
// 2. Get a handle to the small bitmap device context
Bitmap smallBitmap = (Bitmap)(e.Data.GetData(DataFormats.Bitmap));
int smallBitmapHeight = smallBitmap.Height;
int smallBitmapWidth = smallBitmap.Width;
IntPtr smallBitmapHdc = Win32Support.CreateCompatibleDC(largeBitmapHdc); // in-memory
Win32Support.SelectObject(smallBitmapHdc, smallBitmap.GetHbitmap());
// 3. draw the smallBitmap on the largeBitmap
Win32Support.BitBlt(
largeBitmapHdc, // largeBitmap is target
largeBitmapLocation.X, largeBitmapLocation.Y, // destination
smallBitmapWidth, smallBitmapHeight, // source width, height
smallBitmapHdc, // smallBitmap is source
0, 0, // source x,y
Win32Support.TernaryRasterOperations.SRCCOPY);
Graphics memDC = Graphics.FromHdc(smallBitmapHdc); // for ReleaseHdc
IntPtr hMemdc = memDC.GetHdc();
memDC.ReleaseHdc(hMemdc);
largeBitmapDC.ReleaseHdc(largeBitmapHdc);
}
}
charles922
cepeasley@earthlink.net
|
|
|
|
|
charles922 wrote: this.pictureBox2.CreateGraphics();
This is why. If you create a graphics object, then as soon as the paint event is called, it will overdraw whatever you drew. Why on earth would you draw on top of a picture box, that' kind of redundant, isn't it ?
Do your drawing in the paint event, then whenever the control is invalidated, your code will draw what you want drawn.
Why are you using BitBlt instead of using the GDI+ methods ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: draw on top of a picture box
That is a bit on the redundant side...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
A lot of people seem to grab a picture box as 'the thing to use for a picture', then call CreateGraphics to draw on top of it. I'm curious to know how they find out about this method, while simultaneously completely failing to understand what it is for, is there a bad article on CP that points them in that direction ? I keep meaning to write an article on what CreateGraphics is and isn't good for, and why it's redundant to create a control, just to draw on top of it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: is there a bad article on CP that points them in that direction ?
I am not sure why it is.
Christian Graus wrote: I keep meaning to write an article on what CreateGraphics is and isn't good for, and why it's redundant to create a control, just to draw on top of it.
Go for it. You got my support
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
I havent seen a reason for this misconception either.
Is the name confusing, should it have been called an ImageBox ?
And what is next ? painting text over a TextBox ?
Anyway, I dont use PictureBox at all; I prefer to paint on a Panel.
On one hand I then have to load the image file and do the DrawImage,
on the other hand I can easily add text, borders, whatever, and have the scaling match up.
Greetings.
|
|
|
|
|
Exactly - a lot of the questions relating the picture box involve the assumption that it's a lot more than it is ( I've seen people ask about transitions like Powerpoint, for example )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|