|
i am tring to develop an application which can install any type of software on any platform with out user interaction in dot net.
First of all my application will learn all events and messages at least one time then it will perform the task on the network on any computer.
is it possible?
if yes how?
can some one provide the helping metrial and links about that?
r00d0034@yahoo.com
|
|
|
|
|
when i use that function (AfxGetInstanceHandle())in managed class i got an exception i do not know how to handle it.
how to sue it in managed vc++ code ?
how to sue it in c# code ?
plz help me.
r00d0034@yahoo.com
|
|
|
|
|
- 21 MB for the default .Net framework (you have a link in CP homepage)
- 6MB for .Net SP2
- 6MB for MDAC2.7 if the application uses data access
- and depending on the application the user may be required to install IE6.0 (integration with windows forms, etc.).
And I swallow a small raisin.
|
|
|
|
|
Thanks.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I have a server that accepts a socket connections and accepts authentication requests in a specific protocol. I want to use this for an ASP.NET authentication. How can I make my ASP.NET app maintain a single connection to this auth server and send authentication requests to it?
I mean a COM object does not seem to be the right way anymore. What is the preferred .NET way of implementing this?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I guess the "proper" .NET way of doing this is to write a class that takes the credentials and performs the authentication against the server. You create this object then once and store it in the Application context. But beware you better build this object with sound multithreading capabilities, otherwise this might become a severe performance bottleneck.
--Chris
|
|
|
|
|
So, what you suggest is that I create the class and initialize it on Application Start and clean it up when the Application quits (I am so new to .NET that I do not know the event names).
ok.. So this class would create multiple threads that maintain the session with my authentication server.
Sounds fine. Now I have to go about designing it.
Thank you
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Well with multithreaded I meant: I can handle multiple requests at the same time. Not that it creates multiple threads itself.
Think of 50 users hitting your page concurrently. It would be bad if all had to queue up to be authenticated one after another.
|
|
|
|
|
I was recently given an assignment which I thought would be very easy, but which is turning out not to be. Our application has a huge, MFC based, activeX control which runs in the browser. We want to use .NET to capture the bulk of this control's behavior on the server side.
However, part of the ActiveX control's behavior involves dragging and dropping icons on to images. We want to do this on the client side. (i.e., capture mousemove events for draging and dropping on the client side browser so that we are not making too many round trips to the server) In other words, we want the UI of the ActiveX control to work exactly as it does now in the browser, only with .NET tools.
Is this possible?
I can get the behavior I want by using .NET Windows forms controls. But Windows forms controls cannot be used in a browser. (At least I can't get them to). I can get some of the behavior useing .NET Web forms controls, but again, the interactivity with a web form control is limited because of the round trip nature of interacting between client and server.
I have come down to the opinion that the answer is to use a light weight ATL ActiveX control containing a web service proxy to communicate with the server. However, my supervisor insists that this is doable with a pure .NET solution. I can't find one.
Any ideas?
|
|
|
|
|
I'm having trouble with my MFC applications. Recently I've moved my projects from using the old Visual Studio 6.0 to Visual Studio .NET. I've also changed my operating system from Windows 2000 to Windows XP.
However, after I re-compiled and re-distributed my projects in Visual C++ .NET, I was informed by many of my clients that the applications will not open on their platforms (which they do not have Visual Studio installed). The errors being that there are several DLL files missing, including mfc70.dll and msvcr70.dll and a few others. I've tried to include those DLL files in the distribution packages, but that will increase the size of packages from less than 100K to over 1M. I've also tried to build my application using MFC in a static library instead of in a shared DLL. But that will still increase the size of my applications significantly.
But even with the above solutions, there are still problems. While my applications open on my clients' platform, some of the functionalities are loss (for example, the CFileDialog class doesn't work anymore).
This should be a common problem for many developers, I wonder if there's a better solution. Most of my clients are using Windows 2000 and Windows 98. Only a few of them are using Windows XP.
Thank you to anyone who can give me some advice.
J.
|
|
|
|
|
Well if you can you could run VS 6 and VS.NET side-by-side on the same machine.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
This is a common problem.
I suggest adding a build using MFC as a static library. As you noted, this creates a large executable, but not nearly as large as the entire DLL package. It will let a client run the software until they can update to the mfc70 DLLs.
I'd also create a distribution with just the shared DLLs (and maybe a token executable to satisfy Microsoft distribution requirements, though I haven't verified if this is needed. I've long been annoyed that Microsoft a) doesn't, in the past at least, update the MFC DLLs with service packs and b) doesn't provide such a package through Windows Update or other obvious place.) This allows those who've already updated their DLLs to simply download the new, smaller, builds.
(Perhaps the installer could download the DLL package if required? Though this is a problem with modem users.)
Finally, you need a multi-boot machine with all the platforms you support.
BTW, several common controls are updated by IE, though I don't know if the file dialog is one of them.
And check your MSDN documentation; [almost?] all common controls have weird version limitations.
|
|
|
|
|
who to communicate with a process.lets say there are a number of components on its main window how to pass messages to them,who to passs data to their edit boxes and text areas.
who to get its mainwindow hawndle i tried to get its hwndle like that
Process tmpProcess;
..
tmpProcess.start();
tmpProcess.WaitForInputIdle();
IntPtr hWnd=tmpProcess.MainWindowHandle;
HWND t_hwnd=(HWND)hWnd.ToInt32();
but thats not its main window handle because when i get its rectangle its points are not correct.
what to do if i want to have processes mainwindow hwnd?
i also want to get process main window new handle when its window changes after some processing how to get it?
is there any other way to communicate with process ?
plz provide the helping metrial and related links for that?
i will be very thank full to u.
r00d0034@yahoo.com
|
|
|
|
|
Hi all. I'm creating a nice little database app that exports things to XML. As a printing solution, I've used XSL to make the XML into XHTML (acronyms are fun! ). Then I make IE print it with this line:
System.Diagnostics.Process.Start("rundll32.exe", "C:\\WINDOWS\\System32\\mshtml.dll,PrintHTML \"" + tempFilename2 + "\"");
(tempFilename2 is the name of the temporary .html filename I've generated.)
That works great, but only for File > Print. Any ideas on how to to a File > Print Preview or File > Page Setup? Maybe some kind of DDE thing? I dunno...
Someone must have done this before, is why I'm asking. Any help would be nice, thanks!
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
I suggest to use the WebBrowser control (IE). You can show ther a page preview and a page setup.
The only minus of this workaround is that you must insert the control into your form ( or maybe it gives you another cool feature )
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
Is there any way to do this without descending into unmanaged land? I'm using pure C# here. If not, teach me please?
Regarding placement, I can probably just set the width and height to zero.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
No problem.
First of all, you need to add WebBrowser support to your project. Right click on the toolbox and select Customize toolbox... On the tab page click Browse... and open shdocvw.dll which is located in the windows\system32 folder.
Now you can draw the control on your form.
The next thing which you must do it to load the document which you want to print.
Object missing = System.Reflection.Missing.Value;
axWebBrowser1.Navigate( "http://www.codeproject.com", ref missing,
ref missing, ref missing, ref missing);
Print
axWebBrowser1.ExecWB( SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing );
PageSetup
axWebBrowser1.ExecWB( SHDocVw.OLECMDID.OLECMDID_PAGESETUP,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing );
PrintPreview
axWebBrowser1.ExecWB( SHDocVw.OLECMDID.OLECMDID_PRINTPREVIEW,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing );
But be careful. The functions will fail if the document is not fully loaded. You can determine this thorugh NavigateComplete event.
And that's all. If you've got any question simply post it.
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
This works great, with one problem that I just need a little clarification on to fix. I get an exception the first time I try to do anything with this code, and I guessed that this is because the document is not fully loaded until then, like you said. Now I'm trying to do something like this:
void PrintOperation(EventHandler operationToDo)
{
this.printingBrowser.NavigateComplete2 += operationToDo;
}
And have the EventHandler that's passed to PrintOperation do something like
axWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINTPREVIEW, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing);
The problem is, it isn't letting me subscribe a vanilla EventHandler to the weird type of event handler NavigateComplete2 is. So, my question is, how could I fire a function upon completion of the navigation?
Thanks so much, this solution is absolutely perfect.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
You're saying that you can't subscribe EventHandler which is invoked after a page is fully loaded, am I right. Or are you asking for something else?
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
Well, what I'm saying is that my program is throwing an exception the first time I call ExecWB after a Navigate. I assume this is because the page isn't fully loaded, as you noted above. So:
How can I call a function when the page is loaded? I don't care how this is done -- an EventHandler, an NavigateComplete2 event, whatever.
Alternatively, if I'm wrong on why the exception is being thrown, tell me how to fix it.
Thanks!
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
I've got an idea. Make a class variable of type OperationToDo
private enum OperationToDo
{
Print = 1,
Preview = 2,
PageSetup = 3,
None = 4,
}
private OperationToDo m_eOperationToDo;
In the PageSetup function set the variable to the appropriate value, in this case PageSetup.
private void PageSetup()
{
m_eOperationToDo = OperationToDo.PageSetup;
LoadPage();
}
In the NavigateComplete2 EventHandler check what operation was launched and invoke it.
private void NavigateComplete2 ( ... )
{
if ( m_eOperationToDo == OperationToDo.PageSetup )
else if ( ... )
m_eOperationToDo = OperationToDo.None;
}
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
Thanks so much for your help. If your interested, here's my solution:
private void DoPrintOperation(SHDocVw.OLECMDID operation)
{
this.printOperation = operation;
object missing = Missing.Value;
this.printingBrowser.Navigate(tempFilename2, ref missing, ref missing, ref missing, ref missing);
}
private void printOperationEventHandler(object sender, AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e)
{
object missing = Missing.Value;
this.printingBrowser.ExecWB(this.printOperation, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing);
}
Then in my event handlers, I have these code snippets:
this.DoPrintOperation(SHDocVw.OLECMDID.OLECMDID_PRINT);
this.DoPrintOperation(SHDocVw.OLECMDID.OLECMDID_PRINTPREVIEW);
this.DoPrintOperation(SHDocVw.OLECMDID.OLECMDID_PAGESETUP);
Pretty elegant!
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
I have made a downloader in C# where several threads retrieve data simultaneously.
The real problem is that it takes 90%-99% of the CPU time. It is not that my CPU is slow, but I have mistaken something.
I put the threads priority to the lowest and it is still the same.
I profiled the app and it said that most of the time is spend in the actual retrieving of data... But this should not be CPU intensive.
Does someone have any ideas?
|
|
|
|
|
Rincewind wrote:
I put the threads priority to the lowest and it is still the same.
Lowest priority only means that it won't try to steal CPU time from other threads/applications that want it; if your application is the only one trying to use the processor then it will get the processor.
Without any code I cannot make any assumptions as to why it is using that much of the processor.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
you are prob. going round a loop...
have a look at BITS
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|