|
Nishant S wrote:
How do you make an MFC object that is remotable? Or is this impossible?
Can't you serialize it and then reconstruct it when you receive it?
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
I'm in the design stage for an app I'm going to work on, and I need some guidance.
The architecture is this:
Web UI connected to an Access database on the server. There will be multiple users using the gui concurrently, and I want the all of the current UI's to automatically update themselves whenever a user makes a change that affects the database.
an example of what I need to learn how to do:
Bob is in Toronto, Gina is in Atlanta. They're both logged into the application and they're viewing the same UI, which displays a list of items from the database. Bob selects an item from the list and hits the "order" button. The item is removed from the "available items" list and placed into Bob's "order list". Meanwhile, Gina's UI updates automatically, indicating that Bob has just ordered the item, and it is removed from Gina's "available item" list.
What I need to know is what resources can I use in .NET to make this work? How do I make an event in one UI session update the UI of another session? I want to avoid the appearance of a constantly reloading page. Is this possible????
Thanks in advance for any help!
|
|
|
|
|
Ok, based on the advice I'd received, it apears I need to do the following. I need you guys to let me know if it can be done, and if so, what C# api's/technologies/resources are best to use for it:
1) create an ActiveX component that contains all the UI elements I need and has "listening" capability for databse events.
2) set up 2-way messaging for UI events and data updates between the component and a "contoller process" running on the server that can manipulate the database and spam out updates to the listening ActiveX controls.
The UI design and the database manipulation do not intimidate me. What does is the messaging between the server and the client-side control. This is where I need the most help.
Hope this clarifies things!
|
|
|
|
|
I'm trying to make a combo box where the mouse wheel does not work and/or bubbles the event up to the parent.
Creating a new ComboBox class where OnMouseWheel is overridden does not work, nor does adding an event handler for the MouseWheel event. In both cases I get the event, but the combo box has already scrolled, defeating the purpose. Even when I put in a breakpoint I can see the new item in the combo box before my breakpoint is hit.
Basically, in this app changing a combo box means reading in a whole set of new data, so I want to force the MouseWheel to be only for the scrollable area of the display.
John Woodard
|
|
|
|
|
MouseWheel events are often a pain, as they are not part of the original Win32 API, and diverted to extra DLLs like those in IntelliPoint or Logitech mouse software. Standard window behaviour is to bubble the event to a parent window, and wheel scrolls are automatically handled.
From your description, it sounds like wheel events are processed before OnMouseWheel() is called to signal the event, so presumably it just acts as a post-event notification. I have struggled with this before in both MFC and .Net.
You might want to intercept WM_MOUSEWHEEL earlier on, by overriding PreProcessMessage(). Controls intercept all, and pre-handle several messages, at that stage, before passing the messages (and some never propogate further) to the defined event handlers. By not passing WM_MOUSEWHEEL to base.PreProcessMessage(), you should be able to keep the parent from handling it.
Cheers
|
|
|
|
|
We are devloping a C# .NET Application and are thinking about creating a skinning function for it.
Would like to be able to create a XML document that could be loaded in and the application look and feel would change. I have looked at the stardock.com OCX control - but do not think it will work in .NET and also quite expensive.
There must be some other way of doing it - other than by hand ?
Thanks
Paul
|
|
|
|
|
I have a windows app, and I need to check for some files on a webserver; retrieving their dates (last modified for example). Can I do this via http, or do I have to use ftp for that?
|
|
|
|
|
|
I am trying to find some code examples or source code that would show me how to create a pure tone in C# and assign it to a DirectSound buffer so that I can play it.
I have searched on Google for tone generators and sine wave generation etc but there is nothing that shows me how to create the tone from scratch. DirectSound allows me to read, create, and play a wav or other media formated file by creating a DirectSound device and playing it in a buffer, but I can't find anything on creating a tone from scratch.
I need to be able to create a tone from scratch at a certian frequency.. play it for a specific time be able to control the panning from right to left and control the volume. I am pretty sure I know how to do all of the the manipulation once I have the tone playing. I just need help with the actual generation.
Any ideas or help would be appreciated.
Mike.
|
|
|
|
|
|
I'm C# newbie and I'm jumping right into Database programming. I need to retrieve a GUID column from a DataGrid/DataSet/DataView and I have this problem.
Can you cast String to Guid? and Guid to String?
norm
|
|
|
|
|
You can do both approach's
Guid myGuid = Guid.NewGuid();
string mystring = myGuid.ToString();
or
string myString = "{9729A19E-55FE-4fd9-F5B1-E0212209A0C4}";
Guid myGuid = new Guid(myString);
SB
|
|
|
|
|
yes, but i dont think you can cast...
Guid gdMsgID;
String strMsgID;
//Testing 1: This will NOT work. CS0030: Cannot convert type 'System.Guid' to 'string'
gdMsgID = Guid.NewGuid();
strMsgID = (String) gdMsgID;
//Testing 2: Again, this will NOT work. CS0030: Cannot convert type 'string' to 'System.Guid'
gdMsgID = (Guid) strMsgID;
norm
|
|
|
|
|
im looking to add a spell checker type system to my program. I have found a few user made ones before but i they all basicly like a script (enter the word at a website and then downloading the results) it worked fine..but i want it to work offline as well. So my question is...does anyone know where i can find a complete dictionary....in text or strings (atlest maybe then i can make some kind of interface)....this might possibly the only un-awnserable question on CodeProject.
P.S: Why create my own? so then i can say i did it of course...
Thanks Alot
Jesse M.
The Code Project Is Your Friend...
|
|
|
|
|
WordNet[^]
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Philip Fitzsimons wrote:
WordNet[^]
The best "GPL" dictionary I have found online. The DB setup was a bit tricky at first, but I read a bit of the PROLOG stuff, it was rather logical.
MyDUMeter: a .NET DUMeter clone
|
|
|
|
|
Hi!
I have four 'basic' structures, and I have one 'collection' structure, which contains my 'basic' structures. This works fine until I make a structure array into my 'collection' structure. So, now I'm asking help, how should I define this structure array inside another structure?
See code:
using System;<br />
using System.Runtime.InteropServices;<br />
using Microsoft.Win32;<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class MSSD<br />
{ <br />
public byte msf;<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]<br />
public byte[] mso;<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]<br />
public byte[] ovn;<br />
public byte br;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class FHPD<br />
{<br />
public byte spul;<br />
public byte spm;<br />
public byte spss;<br />
public byte spls;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class RHPD<br />
{<br />
public byte spul;<br />
public byte spm;<br />
public byte spss;<br />
public byte spls;<br />
public byte sps;<br />
public byte spd;<br />
public byte ac;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class HPD<br />
{<br />
public byte csr;<br />
public byte csl;<br />
public byte cgr;<br />
public byte crl;<br />
public byte rtron;<br />
public byte rtroff;<br />
public byte rtlon;<br />
public byte rtloff;<br />
public byte moo;<br />
public byte arf;<br />
public byte alf;<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]<br />
public uint[] qrp;<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]<br />
public uint[] qlp;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public sealed class PAD<br />
{<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]<br />
public byte[] sn;<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)]<br />
public byte[] ct;<br />
[MarshalAs(UnmanagedType.Struct)]<br />
public MSSD mss = new MSSD();<br />
[MarshalAs(UnmanagedType.Struct)]<br />
public FHPD fhpd = new FHPD();<br />
[MarshalAs(UnmanagedType.Struct)]<br />
public RHPD rhpd = new RHPD();<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.Struct)]<br />
public HPD[] hpd;<br />
<br />
public PAD()<br />
{<br />
<br />
}<br />
<br />
public void sizeOfPAD()<br />
{<br />
int si = Marshal.SizeOf(this);<br />
Console.WriteLine("the size of PAD is " + si +" bytes.");<br />
}<br />
}
Please, help me!
br. Juha Ka
|
|
|
|
|
|
Hello,
I am using one third party control.
When I am going to place that control on my form it is showing following error.
An exception occurred while trying to creating an instance of "XPMenus.Menus.MenuControl". The Exception was "the type of intializer for
"XPMenus.Menus.MenuControl" threw an exception.
chito.
|
|
|
|
|
chito wrote:
the type of intializer for
"XPMenus.Menus.MenuControl"
This basically means that there was an exception thrown in the static constructor of the XPMenus.Menus.MenuControl class. A static constructor is generally used to initialize some global/static data for the class because it is called before the first time the class is used (if I remember correctly).
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
public void ExeQueryCmdArray(NewDBClass.DbName dbName, String[] sQuery)
{
this.dbNameCache = dbName;
this.DbInstance(dbName);
OleDbCommand cmdCommon1 ;
OleDbCommand cmdCommon2 ;
OleDbCommand cmdCommon3 ;
try
{
this.conOleDb.Open();
this.transOleDb = this.conOleDb.BeginTransaction();
switch (sQuery.Length)
{
case 2:
cmdCommon1 = new OleDbCommand(sQuery[0],conOleDb,transOleDb);
cmdCommon2 = new OleDbCommand(sQuery[1],conOleDb,transOleDb);
cmdCommon1.ExecuteNonQuery();
cmdCommon2.ExecuteNonQuery();
break;
case 3:
cmdCommon1 = new OleDbCommand(sQuery[0],conOleDb,transOleDb);
cmdCommon2 = new OleDbCommand(sQuery[1],conOleDb,transOleDb);
cmdCommon3 = new OleDbCommand(sQuery[2],conOleDb,transOleDb);
cmdCommon1.ExecuteNonQuery();
cmdCommon2.ExecuteNonQuery();
cmdCommon3.ExecuteNonQuery();
break;
}
this.transOleDb.Commit();
}
catch(System.Data.OleDb.OleDbException oe)
{
ExceptionClass.PrintException(oe.Message);
this.transOleDb.Rollback();
}
catch(System.Exception e)
{
ExceptionClass.PrintException(e.Message);
this.transOleDb.Rollback();
}
finally
{
this.conOleDb.Close();
}
}
I use Access Database, and I want to execute various Insert and Update Query strings.
As you know, That code is very annoying me. So, I'd like to change using [for Loop].
But, I don't know How To...
Is there anyone can help me..
Thanks!!
|
|
|
|
|
bania wrote:
switch (sQuery.Length) { case 2: cmdCommon1 = new OleDbCommand(sQuery[0],conOleDb,transOleDb); cmdCommon2 = new OleDbCommand(sQuery[1],conOleDb,transOleDb); cmdCommon1.ExecuteNonQuery(); cmdCommon2.ExecuteNonQuery(); break; case 3: cmdCommon1 = new OleDbCommand(sQuery[0],conOleDb,transOleDb); cmdCommon2 = new OleDbCommand(sQuery[1],conOleDb,transOleDb); cmdCommon3 = new OleDbCommand(sQuery[2],conOleDb,transOleDb); cmdCommon1.ExecuteNonQuery(); cmdCommon2.ExecuteNonQuery(); cmdCommon3.ExecuteNonQuery(); break; }
Replace with:
foreach (string q in sQuery)
{
new OleDbCommand (q, conOleDb,transOleDb).ExecuteNonQuery();
}
MyDUMeter: a .NET DUMeter clone
|
|
|
|
|
I made it!!
Thank you...
|
|
|
|
|
Hi,
does Datagrid's Row has a tag property ? like control (Label/text) has a Tag (objecT) property which can store any object associate with it. so the same way I need to store an object with
each and every row of the datagrid ?
how do i do that?
Paresh
|
|
|
|
|
I was reading Joel Neubeck's article on watermarking (http://www.codeproject.com/csharp/Watermark.asp) and found it very interesting and helpful.
But I was left with the question, is there a method available that enables the drawing of text diagonally on an image, or even rotated 90 degrees for a vertical effect (such as vertically drawn up the right hand side of the graphic).
Any info would be great!
Thanks.
Bill Koch
|
|
|
|