|
Steve Holdorf wrote: The static PatientManager object is part of the BL and not presentation layer so Application/Session objects should not be needed. Am I missing anything?
That does not seem clear to me. This static PatientManager is a static instance in what process? The ASP.NET process? This is the same process in which Application and Session memory are located (unless of course you use out of proc session but I don't see you mentioning that). Therefore you have no distinction between your presentation layer and your business layer in terms of memory management. If you are placing the PatientManager in the COM+ server then it's not part of the presentation tier of your system. If you are using COM+ for this PatientManager you can configure it in COM+ as a Single Instance so you don't need to make it a static instance.
Steve Holdorf wrote: the static PatientManager should maintain both. Am I wrong?
That sounds like you are planning to use it for write operations yes? So if you have a static instance in a multi-threaded environment you are going to deal with all the synchronization issues yourself then? If so it sounds like you are headed down a long hard path. Good luck.
led mike
|
|
|
|
|
If you are storing the patient list in a static variable, then you don't need to store it in the cache also.
You should be really careful with static variables in a web application, though. The variable is shared by all threads running in the application, so if you ever change it, you need to use locking every time that you access it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guy's
My trouble has been going from a WinForms developer to an ASP developer. I now realize that the generic list I was using was not persistent but the cache is. What I am doing is if it is the first call to PatientManager.GetPatients, I get the list from the database. Now, on the same page (After postback), if it is needed again (for sorting, paging, etc.) then I get it from the PatientManager.GetPatients cache. Do I now make sense?
Thanks again for all of your help!!!!!!!!!!!!!!!!!!!!!!!! I Got it.
Steve
|
|
|
|
|
I have a C#.Net class library called myProcessor.dll in which i am running one VB Script written in myDoc.txt and this VB Script is calling a public method in myProcessor.dll. This is throwing an exception in C# "object required 'MyProcessor'". Here MyProcessor is the object I used in VB Script to invoke the method.
like
MyProcessor.SetValue
The same logic works fine in VB dll and it is installed in "c:\WINDOWS\System32", but here .Net Dll is installed in the path "c:\Program Files\MyPath\"
I haven't created the object by using CreateObject() as without that it is working fine in VB. The same VB Script i used in .Net.
Can anybody tell me the difference in VB and .Net calls to VB Script and the usage of its objects and methods in VB Scripts?
With Regards,
Abraham Chethuvelil
|
|
|
|
|
I would guess that you should use CreateObject and make your C# code a COM dll.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Is there any way other than that, as I am trying to migrate something fromVB to .Net and in VB version it is not a COM dll.....
With Regards,
Abraham Chethuvelil
|
|
|
|
|
I have no idea how VB6 works, sorry. I do know that VB.NET is a whole new language, I would not be surprised if something like this was there and is gone.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
One more query,
I used set MyProcessor = CreateObject("Processor.myProcessor")
MyProcessor.SetValue
but it is giving another error "ActiveX can't create the object 'Processor.myProcessor'"
It seems like The dll is not registered as ActiveX Object.
What I did was in the project properties -> Build -> Output, I checked the option register for COM interop
and in Project properties -> Application -> Assembly Information -> Make assemble visible is too checked.
What else i have to do to register this dll.
Please note regsvr32 wont work as it is saying could not find the entry point.
Please advise
With Regards,
Abraham Chethuvelil
|
|
|
|
|
Hi!
Deep under the "Visual Studio" part of the documentation there is a chapter named "Exposing .NET Framework Components to COM" (under ".NET Framework Development...", ".NET Framework Advanced Development", "Interoperability", "Interoperating with Unmanaged Code"). You will find your options there, under "Registering Assemblies with COM". Or google that for the MSDN location of the piece.
The tool you use (corresponds to regsvr32) is regasm. The other settings you have made should cover the rest of what is needed. Additionally, you can use the ClassInterface, ProgId and Guid attributes on your class if you want to override the defaults (look them up in the docs). As long as you only call your component via late binding (using COM, that is), you needn't worry about versioning (script engines are by definition late bound).
Hope this helped.
--
Peter
|
|
|
|
|
Arun Abraham Jose wrote: in VB version it is not a COM dll
I am pretty sure that it is, otherwise VBScript can not use it.
A COM dll is also commonly known as an ActiveX dll. (This statement may not be totally accurate in every aspect, but for your purpose they are interchangeable.)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
You are correct it is an ActiveX dll. But how can I make use of the same functionality in C#.Net dlls. In the previous mail I mentioned some ways I used and also It is going with a installable and the files will be installed to C:\Program Files\MyPath\ and not to System32 as VB version did. Is that a problem?
With Regards,
Abraham Chethuvelil
|
|
|
|
|
Thanks Buddies. It worked fine. I went in the same way I said. creating the dll as COM interop and as a visible assembly and it worked fine without using CreatObject too.
With Regards,
Abraham Chethuvelil
|
|
|
|
|
Hi, im trying to draw text from a richtextbox into an image, using the drawtobitmap method but my problem is the image file doesnt print everything, it just print the control without anythin, can someone please help, here is my code.
Bitmap bi = new Bitmap(this.rtfbody.Width + 200, this.rtfbody.Width + 200);
bi.SetResolution(3000, 3000);
Control rf = new Control();
// rf = rtfbody.CreateControl();
// rtfbody.CreateGraphics();
rtfbody.DrawToBitmap(bi, new Rectangle(0, 0, rtfbody.Width + 200, rtfbody.Height + 200));
bi.Save(@"c:\abc.bmp",ImageFormat.Bmp); //, PixelFormat.Format24bppRgb);
|
|
|
|
|
1. Get a snapshot of the screen using Graphics.CopyFromScreen()
2. Find the coordinates of the RichTextBox on the screen using PointToScreen()
3. Copy the corresponding portion of the screen snapshot onto your bitmap.
|
|
|
|
|
and hope there's no other window on top of it.
|
|
|
|
|
omlac,
Does "rtfbody" have any text in it?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
yes rtfbody has got text and i pasted a picture in it, that i want to be saved.
|
|
|
|
|
|
thanks very much the your help. the links looks like its perfect but will i be able to send it to a file, i dont seem to find where the file is saved.
|
|
|
|
|
i have discovered that the file is saved through windows dialogue(directory) box. but i didnt want users to do this.
is there another way of doing this.
|
|
|
|
|
<!-- language: lang-vb -->
Panel1.Dock = DockStyle.None ' If Panel Dockstyle is in Fill mode
Panel1.Width = 5000 ' Original Size without scrollbar
Panel1.Height = 5000 ' Original Size without scrollbar
Dim bmp As New Bitmap(Me.Panel1.Width, Me.Panel1.Height)
Me.Panel1.DrawToBitmap(bmp, New Rectangle(0, 0, Me.Panel1.Width, Me.Panel1.Height))
'Me.Panel1.DrawToBitmap(bmp, Panel1.ClientRectangle)
bmp.Save("C:\panel.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Panel1.Dock = DockStyle.Fill
**Note:** Its working fine
I have no idea for printing but I think it will be useful to you
Regards
R Muruganandhan
ShipNet Software Solutions India Pvt Ltd, Chennai
|
|
|
|
|
I want to export my tree view data into different format like -
- PDF
- tiff
- Word
- Html
- Excel
using C#..
If anyone know anything it will be appreciable ..
Thanks in advance..
|
|
|
|
|
Are you sure you know what you really want here? tiff is an image format, how would you show a tree view in pdf/word/excel? In html you would probably want a mixture of text and images.
I think you need to redefine what you are trying to achieve.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hey Bob,
I have a tree control and the data which displayed in that tree control I need to Export into "Pdf, tiff, Html, Word and Excel"...
I think this will clear my question to you...
|
|
|
|
|
Well, there is no simple answer. All of these formats require significant coding which you will need to research individually. Writing to MS applications is relatively simple, writing to HTML is just a case of putting the applicable tags around your data etc.
I think Google is about to become your new best friend
Bob
Ashfield Consultants Ltd
|
|
|
|