|
Hi all,
Here I come with another problem : I want to create a form that will show as a dialog like a MessageBox, I know Windows Mobile permits it as I saw it in other apps, but how can I achieve this using .NET CF ?
Thanx,
Stephane
|
|
|
|
|
Stephane,
I had to create a form that simulated the MessageBox for a CF project. If you are still stuck, let me know and I dig out the source and e-mail it to you.
|
|
|
|
|
Hi !
Yes I would be really gratefull to you if you could send me the source code because I really don't know how to do it ...
Thanks so much !
Stéphane
|
|
|
|
|
Stephane,
If you send me your e-mail address to 'barkingtreeAThotmail.com' (remember to change the AT ), and I will send the source file and the resx for the form.
|
|
|
|
|
I want to make a user control with an image embeded in it,
this image will be use in design time
|
|
|
|
|
If you embedd it as a resource, you can access it from there. But you're saying you want the user to see it when designing a form ? Is it just a logo ? Create a control that displays the image, and it should work.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thank you but I embedd the image in the control library but i dont know how to load it
can you answer me
sorry for my bad English
|
|
|
|
|
Oh, OK. You use the resource manager to load it, using the fully qualified namespace and file name. Do you just want to expose it as a Bitmap property on your class ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am making a control. Should I override functions like OnMouseMove, OnMouseLeave, OnPaint etc or should i create an event handler like this.MouseMove += new blah blah for these
|
|
|
|
|
Depends, really. I tend to override, so I can control when/if the base is called.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
If your creating a control by combining multiple existing controls onto a UserControl form, I would use event handlers. If your creating a completely new custom control by deriving from Control, the best option, and for all intents the only option, is to override the protected members like OnPain, OnResize, OnMouse*, etc.
|
|
|
|
|
i need whole ur help about connecting , inserting, updating ,etc. information to MSAccess,
please give me a whole code sample,
i need a code that could insert to a table.
tnx alot,
ASPERSICA
|
|
|
|
|
Hi there,
First, I think u need to have an overview about ADO.NET technology and then u can try to practise on this
take a look on this link
ADO.NET Overivew
<< >>
|
|
|
|
|
I currently have a method in a class library that is being accessed via .net remoting. The remote object handles active directory functions such as authentication, and getting the groups associated with an authenticated user. My problem is that when I call the method to get the groups for the authenticated user, it fails (something about not being able to find the domain or ldap server), but when i copy that method into my web app and call it directly from the web app, it works fine. Here is the code in the remote object's method:
<code>
public string GetGroups(string strPath, string strFilterAttribute)
{
DirectorySearcher search = new DirectorySearcher(strPath);
search.Filter = "(cn=" + strFilterAttribute + ")";
search.PropertiesToLoad.Add("memberOf");
StringBuilder groupNames = new StringBuilder();
try
{
SearchResult result = search.FindOne();
int propertyCount = result.Properties["memberOf"].Count;
string dn;
int equalsIndex, commaIndex;
for(int propertyCounter = 0; propertyCounter < propertyCount; propertyCounter++)
{
dn = (string)result.Properties["memberOf"][propertyCounter];
equalsIndex = dn.IndexOf("=", 1);
commaIndex = dn.IndexOf(",", 1);
if(-1 == equalsIndex)
{
return null;
}
groupNames.Append(dn.Substring((equalsIndex + 1), (commaIndex - equalsIndex) - 1));
groupNames.Append("|");
}
}
catch(Exception ex)
{
throw new Exception("Error obtaining group names. " + ex.Message);
}
return groupNames.ToString();
}
</code>
I use this to call it remotely (the necessary set up to call the remote object is already taken care of at this point):
<code>string strGroups = myRemote.GetGroups(strPath, strFilterAttribute);</code>
This way causes the error, but when I copy and paste the same method into my web app, I call this way:
<code>string strGroups = GetGroups(strPath, strFilterAttribute);</code>
and it works perfectly. Does anyone have any ideas as to why? Also is there a way to run my web app in debug mode and at the same time run my remote object in debug mode so that I can step into it when it is called? I remember doing this in VB 6 with COM objects (dlls).
Thanks in advance
|
|
|
|
|
Is your class derived from MarshalByRefObject? Or is it serializable?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi Senthil,
Thanks for your response, my class is derived via MarshalByRefObject.
|
|
|
|
|
Hi
please I need help, i need icon in system tray which manages my window service. windows service run on my computer but it doesnt show the icon. and other thing is how i can send messages to window service to do some perticular stuff.
|
|
|
|
|
We'll need some more information before we can help in regards to the notification icon problem (systray icon). Do you already have code to display a system tray icon, or do you need help adding that code?
As for communicating with your windows service, there are many ways, and it all depends on the environment the service is intended to be used in, and what kind of performance you need out of the communication protocol. You can use named pipes (there are several EXCELLENT implementations of named pipe communication here on CodeProject), .NET Remoting (search this site and google for it), as well as custom implementations such as with TCP/IP. Again, more information is needed before useful advice can be given.
|
|
|
|
|
HI Jon Rista,
Thank you for speedy reply.
In my project I need to create communication between .net application and MFC application on the same machine.
Please help me.. after resolving this communcation problem i will handle system tray problem.
Thanks in advance.
Regards,
vidya
|
|
|
|
|
If you want to communicate between dissimilar apps like that (and dissimilar platforms), I would say the best option is TCP/IP if you need to communicate accross a network, or Named Pipes if you just need to communicate to the same machine. There are a couple good named pipe implementations here on CodeProject that should help you get started. You will need to write custom communication code for each app.
|
|
|
|
|
I have an XML formatted string that my program receives from any number of other programs.
It may contain:
<br />
< value="name" type="string" >Aristotle< /value > (Without spaces around value tags)<br />
I need to have a collection which will dynamically create those variables inside itself, but I'm not sure how to do this.
Something like:
public class XMLParser
{
string m_RawXML;
CollectionWithMultipleTypes m_Values = new CollectionWithMultipleTypes() // IS THERE A COLLECTION TYPE BUILT FOR THIS PURPOSE?
public XMLParser(string RawXML)
{
ParseXMLString(string RawXML);
}
public void ParseXMLString(string RawXML)
{
string[] ValueStringsArray = GetValueStrings(string RawXML);
foreach(string valueString in ValueStringsArray)
{
try
{
// Parse string to create new type with name and store data in it
mValues.Add(newVal);
}
catch(Exception err)
{
MessageBox.Show(err.ToString());
}
}
}
}
So, my questions are: Is there a datatype in C# that can store mulitple types of data in it? There aren't built in XML functions for recreating data types from a string, are there? Is this a viable approach? If it is, does anyone have any code that might simplify my life?
As always, Thanks!
-- modified at 15:22 Thursday 3rd November, 2005
|
|
|
|
|
budidharma wrote: So, my questions are: Is there a datatype in C# that can store mulitple types of data in it?
Since all classes are derived from the Object class any collection that can hold objects (e.g. an Array or ArrayList) is capable of holding objects of any class.
For recreating objects from XML I think you'll want to look in to the Reflection classes. You'd need to extract the type attribute from your XML string and use reflection to try and create the object of that class. Maybe it would also be possible to use serialization to recreate your objects?
|
|
|
|
|
Is there a build in XMLRead type command that will retrieve name value pairs from an xml formatted string?
|
|
|
|
|
|
I would check out the XmlTextReader class. Its a very low-profile, rapid, and generally forward-specific class that can blast through huge xml files in short order. Its VERY easy to use, and should solve your problem in a heartbeat. You can likewise use XmlTextWriter to reserialize your collection to similar xml, too.
|
|
|
|