|
Hi folks,
I currently have to interop to an old ActiveX control that requires the STA threading model. In order to get the control to work, I have to use STAThreadAttribute on the Main method of my desktop application, and set my ASP.NET application to be ASP compatible.
This has impact on the threading of the rest of the application which is undesirable (especially on the ASP.NET application).
Is there any way to load the ActiveX into a separate STA threaded AppDomain, and keep the main AppDomain MTA? I haven't been able to find any examples or explanations for this.
We need to have considerable interaction with the ActiveX control throughout the rest of our code, and I don't know the impact of cross-AppDomain calls on performance, but I can't test until I find out how to separate the AppDomains.
Any interop/threading guru's out there?
PS. We can't rewrite the Activex control as it is third party (and has been discontinued). It contains complex mathematical parsing that we need to maintain for backward compatability.
Dr Herbie
Remember, half the people out there have below average IQs.
|
|
|
|
|
Hi
I have a mdi form which opens another form inside the container.
there are menus available in both the forms.
when i load the child form in the mdi container the menus appear outside the form as a part of the mdi form menu
how can this happen??
i have checked up with all the names of the menus and their items.
but each is unique
pls help!!
Sukanya
|
|
|
|
|
ok, I have an app that I don't want to to have the blue bar across the top, but I need a way that the user can move the form. how is this done? (I want them to be able to click, hold, and drag anywhere on the form where another control is not covering it).
thanks in advance,
Stephen
|
|
|
|
|
You obviously need to capture the click event, and as the mouse is moved, move your window. In C++, it was ::SetWindowPos, if C# does not have an equivelant, you can just import that function into C#.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I do that in this article. All you need to look at is the form event handler code.
http://www.codeproject.com/dotnet/ABTransClockArticle.asp[^]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I have a reg. expression to search for strings between the "<" and ">" tags. but how do I change the color of all the matches to blue?
|
|
|
|
|
There are few different ways you can do this (as always), you could use the Regex.Split, go through and call Replace on all the matched values with your corresponding value (blue for you) and then use String.Join to put it all back together.
|
|
|
|
|
Yes, but most web pages use cascading style sheets to specify colour. You must grep for '
|
|
|
|
|
Richard Schneider wrote:
Yes, but most web pages use cascading style sheets to specify colour.
The problem is that, 'most', is not inclusive, nor was my response. I was only offering a suggestion on how he might attempt it - there are many possible solutions. Thanks for pointing out that the colors could also be defined within a css file, just as well they could be inlined with the HTML in a <style> tag.
|
|
|
|
|
hai everybody,
i used the following code to cast an item from the hashtable. but i always get an exception that is an invalid casting.
<br />
foreach (Object objActiveObject in _breathObjectHash)<br />
{<br />
ActiveObjectsInLevel tmpObject = (ActiveObjectsInLevel) objActiveObject;<br />
ActiveObjectsInLevel myXml = new ActiveObjectsInLevel(tmpObject.Row,tmpObject.Column,tmpObject.ExistingObjects);<br />
myObject.SetValue(myXml,count);<br />
count++;<br />
}
please help me
Regards,
Rathish P S
|
|
|
|
|
Have you tried this?
<br />
foreach (Object objActiveObject in _breathObjectHash)<br />
{<br />
if( objActiveObject is ActiveObjectsInLevel )<br />
{<br />
ActiveObjectsInLevel tmpObject = (ActiveObjectsInLevel) objActiveObject;<br />
ActiveObjectsInLevel myXml = new ActiveObjectsInLevel(tmpObject.Row,tmpObject.Column,tmpObject.ExistingObjects);<br />
myObject.SetValue(myXml,count);<br />
count++;<br />
}<br />
else<br />
{<br />
Console.WriteLine( "Wrong Type: " + objActiveObject.GetType().ToString() );<br />
}<br />
}<br />
_________________________________
Vote '1' if you're too lazy for a discussion
|
|
|
|
|
hai Corinna John,
thanks for your comment.i tried the above.but always that else part only works so i triedthe following code and succeed.
foreach (Object objActiveObject in _breathObjectHash)
{
int index = objActiveObject.GetHashCode();
ActiveObjectsInLevel tmpObject = (ActiveObjectsInLevel) _breathObjectHash[index];
ActiveObjectsInLevel myXml = new ActiveObjectsInLevel(tmpObject.ObjectKey, tmpObject.Row,tmpObject.Column,tmpObject.ExistingObjects);
myObject.SetValue(myXml,count);
count++;
}
Regards,
Rathish P S
|
|
|
|
|
Hi
In user32.dll there is a function called LockWorkStation.
Is there an complement to it??
Or is there any comparable in msgina.dll?
thx
|
|
|
|
|
|
Stefan, I think he wasn't searching for an equivalent, but for a complement
I guess there's no reverse function to unlock the workstation.
Platform SDK states:
"This function has the same result as pressing Ctrl+Alt+Del and clicking Lock Workstation. To unlock the workstation, the user must log in."
Besides, what would be the point of LockWorkStation if you could unlock it programmatically?
mav
|
|
|
|
|
|
If, by "complement", you mean is there a function to unlock the workstation, no there isn't. The user has to hit Ctrl-Alt-Del and login again. It can't be remotely unlocked for security reasons.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello folks,
I have never been in a project where I need to use legacy dll (non COM dll)
I looked at some examples from that I found in codeproject but I still have some question.
Suppose I have the following methods in my dll:
RF *rfOpen( const char *dev, int mode );
int rfTest ( RF *reader, char *namestr, int namesize, char *verstr, int versize );
where RF declared like this:
typedef struct rfreaderstruct RF;
struct rfreaderstruct {
HANDLE fh;
OVERLAPPED in_ov;
OVERLAPPED out_ov;
unsigned char buffer[BUFSIZ]; /* Read buffer */
int bufferPoint; /* Number of bytes used from inBuf */
int bufferCount; /* The number of bytes in inBuf */
char nonCommandBuffer[BUFSIZ];
int nonCommandBufferPoint;
int nonCommandBufferEnd;
int mode;
int requestInProgress;
int requestOutProgress;
int pendingWrite;
int pendingRead;
RFMessage rfmsg;
int responseState;
unsigned int responseDataCount;
RF *next;
};
how can I make them readable in .Net?
Thanks
|
|
|
|
|
If you never have to manipulate the members of the RF structure, it's pretty straightforward:
[DllImport("legacy.dll")]
public static extern IntPtr rfOpen( string dev, int mode );
[DllImport("legacy.dll")]
public static extern int rfTest( IntPtr reader, StringBuilder namestr, int namesize, StringBuilder verstr, int versize ); For an 'out' string parameter, you should use a StringBuilder . Set the Capacity appropriately and pass that for the namesize parameter.
If you do have to manipulate RF directly, it will be a lot harder.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
does anybody know an opensource report generator like jasper reports written in C#?
I need the ability to show a print preview, send report to printer and create a pdf-document.
Or is it possible to integrate a java-program into a .net-program?
Thanks
Alexander Roos
|
|
|
|
|
|
You need to implement the IInputObject interface.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks for reply Andy
after revieing source file from the proejct
http://www.codeproject.com/csharp/dotnetbandobjects.asp[^]
i found the following mehtods in Bandojectlib.cs file
public virtual void UIActivateIO(Int32 fActivate, ref MSG Msg)
{
if( fActivate != 0 )
{
Control ctrl = GetNextControl(this,true);//first
if( ModifierKeys == Keys.Shift )
ctrl = GetNextControl(ctrl,false );//last
if( ctrl != null ) ctrl.Select();
this.Focus();
}
}
protected override void OnGotFocus(System.EventArgs e)
{
base.OnGotFocus(e);
BandObjectSite.OnFocusChangeIS(this as IInputObject, 1);
}
protected override void OnLostFocus(System.EventArgs e)
{
base.OnLostFocus(e);
if( ActiveControl == null )
BandObjectSite.OnFocusChangeIS(this as IInputObject, 0);
}
How can i cal these methods so that it can enable BACKSPACE key in the toolbar?
kindly guide me please
Thanks
|
|
|
|
|
Check out this article from Microsoft. It's C++, but you should be able to convert it over.
http://msdn.microsoft.com/msdnmag/issues/01/08/c/[^]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks for your reply
i visited the site and did find clue like
it was handled like that in C++ like that:
if (msg==WM_KEYDOWN) {
// on keydown, pass to edit as WM_CHAR
::SendMessage(hwndEdit, WM_CHAR, key, pMsg->lParam);
}
in Delphi i found the following:
function TDelphiBand.TranslateAcceleratorIO(var lpMsg: TMsg): HResult;
// Passes keyboard accelerators to the object.
begin
if (lpMsg.WParam <> VK_TAB) then begin
TranslateMessage(lpMSg);
DispatchMessage(lpMsg);
Result := S_OK;
end
else Result := S_FALSE;
end;
i coudnt find TranslateMessage and DispatchMessage in C#
neither i found SendMessage Equivalent in C#
|
|
|
|