|
Bokang Selialia wrote: i do not know c# but i know c++.
Then this should be very easy.
Bokang Selialia wrote: and as you enter the phone number should establish the connection
So you need to write code to actually recharge a real phone and make real phone calls ? Or do you mean a simulation ? If the latter, you can't know C++ very well if you can't do it. Either way, you're refusing to post code, which means we can't really help you with it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Bokang Selialia wrote: phone.i 'll appreciate your contribution in c# or nedbeans . please help!!! the project is due 27 November 2009. please...
Some observations
1 - if you think we can correct your code without seeing it, you give us too much credit
2 - we don't care when your homework is due. That's your problem. You've been given the resources needed to do it, and it sounds like a trivial task. If you were to post code and a specific question, someone might decide to help if it seems like you need a little bit of advice. But what you posted is utterly worthless, because we're not going to do your homework for you, and we can't correct code we can't see.
What sort of course lets you choose between C# and 'nedbeans' ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Bokang Selialia wrote: the project is due 27 November 200
11 days and ticking, if your teacher has any regard for comments, organization, proper coding I'd say you're as close to failing as you're going to be, well, you know, not including the point at which you actually fail.
|
|
|
|
|
So you have a choice between C#, which is a language, and nedbeans which is an IDE. Not very clever. C# or Java then maybe.
Bet you get the same enthusiasm to help from a Java forum.
Eleven days to go is a poor show when you are still undecided what language to use. Better get cracking if you still care about passing.
When you decide and hit a code problem I'm sure many people will be far happier to assist.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Bokang Selialia wrote: the part that recharges and rating when calling of the pay phone
And how are we to know what that even means? You are asking us to write code for you without a clue as to what you are trying to do.
Even if we knew what you was trying to do, we won't write the code for you. Try rentacoder or on the jobs board.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
I'm working on C# windows forms project using the glass aero effects available in Vista and Win 7, and getting the glow behind text effect using DrawThemeTextEx as per the code below. All works fine with normal aero glass, but if I add some colour to the glass (I'm using LinearGradientBrush) the rectangle around the text is transparent does not include the colour painted with the brush.
I've done a bit of searching and reading, and it appears that CAPTUREBLT is designed to deal with this, but as mentioned in the Miscrosoft documentation it doesn't work properly with DC, which is what I'm using here.
My question therefore is is there another way of adding text using DrawThemeTextEx that will include painted layers?
<br />
public void DrawTextOnGlass(IntPtr hwnd, String text, Font font, Color forecolor, Rectangle bounds, int iglowSize, TextStyle textStyle)<br />
{<br />
if (VistaApi.IsCompositionEnabled())<br />
{<br />
RECT rc = new RECT();<br />
RECT rc2 = new RECT();<br />
<br />
rc.left = bounds.Left - 1 * iglowSize;<br />
rc.right = bounds.Right + 1 * iglowSize;
rc.top = bounds.Top - 1 * iglowSize;<br />
rc.bottom = bounds.Bottom + 1 * iglowSize;<br />
<br />
rc2.left = 0;<br />
rc2.top = 0;<br />
rc2.right = rc.right - rc.left;<br />
rc2.bottom = rc.bottom - rc.top;<br />
<br />
IntPtr destdc = GetDC(hwnd);
IntPtr Memdc = CreateCompatibleDC(destdc);
IntPtr bitmap;<br />
IntPtr bitmapOld = IntPtr.Zero;<br />
IntPtr logfnotOld;<br />
<br />
int uFormat = DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_NOPREFIX;
<br />
BITMAPINFO dib = new BITMAPINFO();<br />
dib.bmiHeader.biHeight = -(rc.bottom - rc.top);
dib.bmiHeader.biWidth = rc.right - rc.left;<br />
dib.bmiHeader.biPlanes = 1;<br />
dib.bmiHeader.biSize = Marshal.SizeOf(typeof(BITMAPINFOHEADER));<br />
dib.bmiHeader.biBitCount = 32;<br />
dib.bmiHeader.biCompression = BI_RGB;<br />
<br />
if (!(SaveDC(Memdc) == 0))<br />
{<br />
bitmap = CreateDIBSection(destdc, ref dib, DIB_RGB_COLORS, 0, IntPtr.Zero, 0);
if (!(bitmap == IntPtr.Zero))<br />
{<br />
bitmapOld = SelectObject(Memdc, bitmap);<br />
IntPtr hFont = font.ToHfont();<br />
logfnotOld = SelectObject(Memdc, hFont);<br />
try<br />
{<br />
System.Windows.Forms.VisualStyles.VisualStyleRenderer renderer = new System.Windows.Forms.VisualStyles.VisualStyleRenderer(System.Windows.Forms.VisualStyles.VisualStyleElement.Window.Caption.Active);<br />
<br />
DTTOPTS dttOpts = new DTTOPTS();<br />
<br />
if (textStyle == TextStyle.Glowing)<br />
{<br />
dttOpts.dwFlags = DTT_COMPOSITED | DTT_GLOWSIZE | DTT_TEXTCOLOR;<br />
}<br />
else<br />
{<br />
dttOpts.dwFlags = DTT_COMPOSITED | DTT_TEXTCOLOR;<br />
}<br />
<br />
uint dwRop = SRCCOPY | CAPTUREBLT;<br />
<br />
uint key = (uint)((forecolor.A << 24) |<br />
(forecolor.R << 0) |<br />
(forecolor.G << 8) |<br />
(forecolor.B << 16));<br />
<br />
dttOpts.crText = key;<br />
dttOpts.dwSize = (uint)Marshal.SizeOf(typeof(DTTOPTS));<br />
dttOpts.iGlowSize = iglowSize;<br />
<br />
DrawThemeTextEx(renderer.Handle, Memdc, 0, 0, text, -1, uFormat, ref rc2, ref dttOpts);<br />
<br />
BitBlt(destdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, Memdc, 0, 0, dwRop);<br />
}<br />
catch (Exception e)<br />
{<br />
Trace.WriteLine(e.Message);<br />
}<br />
<br />
SelectObject(Memdc, bitmapOld);<br />
SelectObject(Memdc, logfnotOld);<br />
DeleteObject(bitmap);<br />
DeleteObject(hFont);<br />
<br />
ReleaseDC(Memdc, -1);<br />
DeleteDC(Memdc);<br />
}<br />
}<br />
}<br />
}<br />
I can send the source code to anyone who wants to take a look, just drop me a message.
Cheers
Rowan
|
|
|
|
|
How would one search for a unicode string written like: ...A.D.J.S.F...
I need to be able to searched typed text with the dots in between so search ABC as .A.B.C. and find the starting offset of that, then replace it with something else like 123 converted to .1.2.3..
I am somewhat new to C# and computers so I may have said some things incorrectly, sorry.
|
|
|
|
|
Given that you're new to C#, why do you find yourself having to understand unicode at this poin ? Where is the string coming from ? Where is it going to ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
There are a few things I want to do and I'm not sure where else to start besides doing things I want to do with C#. The string ABC is coming from textBox1 and needs to be in the format .A.B.C. Not sure what that is but I think its unicode text, and I need to search for that string in the file and then find the starting offset for it, then have the string of text 123 in textBox2 for example converted to the format .1.2.3. And then have that string replace the amount of characters equal to its length at the offset output from the first part.
|
|
|
|
|
krt72012 wrote: and needs to be in the format .A.B.C.
Why does it ? The user has to type it in like that ?
krt72012 wrote: . Not sure what that is but I think its unicode text
No, it is not. Well, all .NET strings are unicode, but the dots don't change that, or define it.
krt72012 wrote: and I need to search for that string in the file and then find the starting offset for it, then have the string of text 123 in textBox2 for example converted to the format .1.2.3. And then have that string replace the amount of characters equal to its length at the offset output from the first part.
OK, this is sounding like homework then ? You're taking a class ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I guess you have to know more about exactly what I'm doing but when I search for a text sting in a hex editor as a unicode string, the string has dots in between each character. What I'm trying to do is search for a halo 3 service tag written in that format inside an xbox 360 profile based on what the user puts in as their service tag, and then have it search and find and replace the service tag with what the user enters in the second text box.
|
|
|
|
|
krt72012 wrote: but when I search for a text sting in a hex editor as a unicode string, the string has dots in between each character
That's because Unicode characters have two bytes and you're looking on the byte level. However, inside a textbox, in .NET, the string is unicode and it's shown just as a string. That is, the A has two bytes to represent it, but you just see the A.
krt72012 wrote: What I'm trying to do is search for a halo 3 service tag written in that format inside an xbox 360 profile based on what the user puts in as their service tag, and then have it search and find and replace the service tag with what the user enters in the second text box.
Ah - OK. Well, if you're in .NET, it will show as unicode. Then you can use File.ReadAllText to read a file, the Replace method on the string class to replace the text in textbox1 with the text in textbox2, and File.WriteAllText to overwrite the file in it's changed format. If the two strings need to be the same length, you'd need to validate that, and of course, if the text entered is so simple that it appears elsewhere in the text to where you WANT to change it, that will be changed as well. In that case, you'd need to use the Find methods to find the actual index and do some work with the substring method to build your new string ( or the replace method may take parameters to specify where in the string it's allowed to look )
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Hi,
I just finished a client which consume a WCF, but it seems to use only IE proxy setting.
I searched Internet and found this article[^] about how to set and HTTP proxy on WCF client-side.
The problem is because my WCF Server is also on local, so ACTUALLY the client app not go out LAN at all (at least that my understanding ) -> not use the Proxy Setting.
Please tell me how i could test this code.
thanks in advance.
|
|
|
|
|
If your service is on the same machine of the client, it shouldn't use a proxy at all.
If you are using the machine name in place of localhost (or 127.0.0.1) in your web service address, it is possible that the proxy is not recognizing it as a remote address. You could try to add it to the proxy exclusion list.
|
|
|
|
|
my service is actually on another machine but still on LAN, and i had to by pass proxy to connect to service. But IMO that means the proxy setting was not used at all, wasnt it??
Also I searched and found this free web service for testing[^]. Is there any site like this for WCF.
|
|
|
|
|
I wondered if somebody could help me. Im progamming in Visual Studio C# and I´d like that as soon as I execute my program it starts searching for bluetooth devices, without showing anything, in background. And when I push a button, the box with the BT devices available appear. Any suggestion?
Thanks a lot
|
|
|
|
|
You can use 32feet[^] library for working with bluetooth devices from c#.
|
|
|
|
|
Hello,
Can any one tell me how to update the member variable of my windows service from another windows Application. I just need to update a flag variable from external windows application. I want to implement this in c#. The Windows service is already made. Just need to set the flag. This flag is needed to control the launch of another windows application from this running windows service.
modified on Monday, November 16, 2009 3:52 AM
|
|
|
|
|
There are some ways.
You can use self-defined service commands, a small TCP/IP connection, named pipes or maybe names events / shared memory. For the last of these possibilities have a look at this posts.
Hope that helps.
Greetings
Covean
|
|
|
|
|
Thank you for your response. If we develop a windows service in VC++ we can add an "Interface" and can add "Method" to it. This method can be exported to outside applications. This Method can be used by external applications by calling CoCreateInstance() and can get the pointer to the interface and this pointer can call the function. I just like to have similar Implementation but both the Windows Service and Windows Application need to be implemented in c#.
Prasad
|
|
|
|
|
The easiest way is to control your service with user-defined service control commands.
See ServiceBase.OnCustomCommand and ServiceController.ExecuteCommand.
Greetings
Covean
|
|
|
|
|
Thankyou Covean,
With this approach i implemented and is working. The Link http://www.codeproject.com/KB/dotnet/WindowsServices.aspx is helpful.
Thanks,
Prasad
|
|
|
|
|
Probably not what you're looking for but perhaps you could simply use some external resource that both applications may access?
If the service uses a FileSystemWatcher it can receive an event when a file changes, and if it only opens the file for reading there should be no problems with the file being in use or anything like that. So the app needing to inform the service of something would simply update a file, or place a new file in a directory, or put the information in a database.
Or why not use a message queue? This would also let you queue messages regardless of whether or not the service is up and running of the time of creating the message.
I'm sure there are many other possibilities, but generally speaking it seems like an odd way of interfacing between applications to have one application directly modify the state of another - you could hardly get further away from the good OOP practice of encapsulation.
|
|
|
|
|
|