|
i'm always ready to learn. unforunately i havn't worked with MFC or windows management APIs. i've tried everything i can think of to get this to work and i tried playing around with the code you gave me but it seems like that code executes at odd times. i had it update a textbox when it drops into the if statement before it returns and it doesn't update it in the same spot everytime, it's weird. i would like to know where you got the WM_NCMOUSEMOVE = 0x00a0 though. what does this mean and why is 0x00a0 an int?
if anyone out there has any input for constricting the movement of a form to stay within it's parent that would be great.
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
I got the constant value from winuser.h, the header with most of the constants defined for the Windows Management and related APIs. You can easily find these if you download and install the Platform SDK, which does get installed by default with VS.NET (though it's not pretty old).
Why is 0x00a0 an int ? You've never seen this notation? It's a simple hexidecimal notation, or base16, which is 0123456789abcdef. So, 10 (a) * 16 = 160. int (Int32 ) is only a 32-bit number, as is 0xXXXX (four alphanumeric characters).
I typically keep the hexidecimal notation that's defined with the C/C++ headers from the PSDK, though, because it makes lookups easier and lets me format my code better.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can I get The all user defined table name from a MSAccess Database using Ado.Net(c#)
This is Jitendra
|
|
|
|
|
You can use a query like the following:
SELECT Name
FROM MSysObjects
WHERE Type = 1 AND Name LIKE "MSys%" All the Access system tables start with "MSys", so unless you expect user tables to begin like this the query above should work fine.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks to u
This is Jitendra
|
|
|
|
|
It gives Problem regarding Permission when I execute the query the permission Exception is raising and saying that u don't have right to read MSys table .
Thanks FCriend
|
|
|
|
|
There is no "MSys" table, but many tables that start with "MSys", which is why I said "MSys*", like a wildcard match. Make sure you specify a proper table and that the credentials (username and password) you log in with have administrative privileges (like the "Admin" user).
Also, don't say things like "the permission Exception". If you need help, be specific and say SecurityException or InvalidOperationException or something like that, along with the exact exception message. There's many things that can go wrong in an application, even in specific blocks of code.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I write a winApp to send EMAIL. Since the server needs to authenticate, so
I need to use TcpClient rather than SMTPMail class. But the problem comes.
Following the DATA tag, I send strings like these:
"Subject:IP Notice"+CRLF;
"This is your IP."+CRLF+"."+CRLF;
But when I receive the mail, only subject was appear and there was no mail body. If I do it in this way, sending the follow strings:
"Subject:IP Notice"+CRLF;
CRLF;
"This is your IP."+CRLF+"."+CRLF;
Then the body exists.
Please do me a favor. I don't know why. Thanks a lot
|
|
|
|
|
This is what the SMTP protocol requires, as well as the HTTP protocol for that matter. You must have to carriage-return, line-feeds after the headers.
See RFC 821[^] (SMTP) for details.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Olap and XML/a .I want to the relationship between
This is Jitendra
|
|
|
|
|
Try the SQL and/or XML forums. This forum is for C#, a programming language for the .NET Framework.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have asked something similar before but was distracted by another part of the app I am implementing and am only getting back to implement this part.
The problem is I have a client/server app. On the client I have a form which acts as a 'splash screen'. Using a combination of a few different methods I have 'locked-down' the client so that it is not possible to use the pc. What I need to do, using remoting, is to allow the server app to hide the splash screen form at the click of a button, therefore allowing users of the pc to use my client app. What I am attempting to implement is a internet cafe management system. All clients are locked until released by the server app by the splashscreen.
I am on a pretty tight time schedule so if anyone could help me with a bit of sample code to allow me to show/hide a remote form, or a nod in the right direction I would be really really grateful,
Thanks in advance,
John
|
|
|
|
|
One easy way would be to declare an interface with the Show and Hide methods:
public interface IVisibleProvider
{
void Show();
void Hide();
} Put this in an assembly shared by the client and server code. The client control can easily implement this - the Show and Hide methods already exist so just implement the interface without having to define the methods and you're done. The server can make calls on the client using this interface using the appropriate activation types (like a singleton or client-activated type) that allow the server to make calls back to the client (so use a TcpChannel as well since HTTP is a client-request, server-respond protocol by nature).
Another way is just to have the client handle the clicks or key presses and call a method on the server - passing some sort of client ID - and the server returns a value that signals if the client can be unlocked or not. If it can, unlock it, otherwise ignore the click or yell at the user. This would be much easier to implement and would allow you not only the ability to use either the TCP or HTTP channels, but also just to use a simple XML web service, much easier to implement and easier to make secure through the Web Service Enhancements (WSE) 1.0 SDK from Microsoft (includes WS-Security, WS-Identity, WS-Routing, and more and easily integrates with Web Service code) if you desired extra security (so users don't intercept messages and change them before they reach their destination).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I implemented the idea using an interface. However I am getting the following error when I leave the system idle for a few minutes and then try to show/hide the form across the network:
"no receiver registered"
From what I have been reading there is a timeout on the leave given to the object. Its getting a bit above my head at the moment. Is there any easy way to set the timeout to never? Have looked at the microsoft site and did a search but its very technical. Any pointers anyone?
Thanks,
John
|
|
|
|
|
This has to do with lifetime management, not connection timeouts. Since all remotable objects must derive from MarshalByRefObject , you can override InitializeLifetimeService and return null , which means the remote object stays active forever.
You should pick up a good book on Remoting, like "Microsoft .NET Remoting" from http://www.microsoft.com/mspress[^] or "Advanced .NET Remoting" from http://www.ingorammer.com[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
I'm trying to globalize my application built with Forms in C#.
The language is to be chosen by user thanks to a ComboBox.
When a language is selected interactively, I set CurrentUICulture, but the problem is that I can't manage to change automatically the Form's language (title, text labels, etc)... unless I close the window and instanciate a new one.
I've tried using Refresh and Update but it has no effect :
private void Combo_SelectedIndexChanged(object sender, System.EventArgs e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(_Lang[Combo.SelectedIndex]);
Refresh();
}
Any idea ?
Regards,
- Éric -
|
|
|
|
|
Refresh and Update have to do with painting, not reassigning values. To do that, you basically have to do everything you would typically find in InitializeComponent except instantiation, i.e. reassign all your resources (strings, sizes, points, etc.) to their controls. If you localize everything that's localizable (which the designer does, which is extremely inefficient) you should do so in between calling the container control's SuspendLayout and ResumeLayout methods for faster layout.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Its there a component or class that can be mapped or assigned to a database table and when the table change (insertion, delete or update) fire an event or send a notifycation to tell the aplication about the change
thanks....
|
|
|
|
|
There is SQL Server Notification Services which is a separate installation apart from SQL Server. IIRC, you can use Web Services or MSMQ. It can send notifications based on SQL events or scheduled events.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have DotNet remoting question and this is related to while development. I am working on C#/windows application. One of client (window form) need to access the method remotely (from remoting server)...Question:
When I am building the client while in development mode do I have to set reference explicitly to the DLL server (remotable object) because if I do that then when moving to production, I don't know in which folder remote server .DLL would be installed.
Favourite quote:
In youth we learn, In age we understand.
|
|
|
|
|
Maybe you can use UDDI? We use it to find a webservice..
|
|
|
|
|
It's recommended you do not share the actual remotable library. Use interfaces instead, and share only the interface. For example
public class MyRemotableDll : MarshalByRefObject, IMyRemotable
{
void SomeMethod()
{
}
}
MyRemotableDll obj = new MyRemotableDll();
RemotingServices.Marshal(obj, "obj.rem");
public interface IMyRemotable
{
void SomeMethod;
}
IMyRemotable theRemoteObj = (IMyRemotable)RemotingServices.Connect(typeof(IMyRemotable), "http://localhost:4030/obj.rem");
theRemoteObj.SomeMethod();
Hope that helps.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Judah,
Thanks for the nice solution. I have further question in your solution and it may sound stupid but help me.
When I am using interfaces on client side how the call reaches to particular piece on server where this interface is implemented. I mean to say that this interface may have been implemented in different different areas. I know that to reach particular piece we do registration of server and give right address (tcp/http) on client side but my question is interface is just an abstract thing. How the call from client actually reaches to server. Please help..
Favourite quote:
In youth we learn, In age we understand.
|
|
|
|
|
In addition to what Judah said (which is the preferred way when you have control over development like this), you can also use soapsuds.exe from the SDK to generate a client proxy (for cases when you can't dictate how the remote object is developed or deployed).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
What library do you use to zip up files? I am using java.util.zip and it's giving me some problems.
Everything works fine if WInZip is installed. However if you uninstall WinZip and it uses the Windows default compresser things don't work so well:
the zip file is created but it's empty.
Does anyone know a solution to this problem?
Thanks,
Elena
Here is my code:
<br />
ZipOutputStream m_zipstream; <br />
string filepath = @"C:\Elena\Junk\test\a.txt";<br />
m_zipstream = new ZipOutputStream( new java.io.FileOutputStream( @"C:\Elena\Junk\test\zip.zip" ) ); <br />
ZipEntry currententry = new ZipEntry(filepath);<br />
currententry.setMethod(ZipEntry.DEFLATED);<br />
<br />
m_zipstream.putNextEntry(currententry);<br />
<br />
try<br />
{ <br />
java.io.FileInputStream current = new java.io.FileInputStream(filepath); <br />
try<br />
{<br />
sbyte[] buffer = new sbyte[8192];<br />
int buffercount;<br />
while ((buffercount = current.read(buffer, 0, buffer.Length)) > 0)<br />
m_zipstream.write(buffer, 0, buffercount);<br />
}<br />
finally { current.close(); }<br />
}<br />
finally { m_zipstream.closeEntry(); }<br />
m_zipstream.close(); <br />
m_zipstream = null;<br />
Elena
|
|
|
|