|
Hi,
Yes that's what I'm trying to do. The dll is written in Fortran so splitting up the routines is definitely not something I want to do.
I was half-expecting the answer to be on multithreading whereby a call would be made to the main process and periodically a call would be made to the fortran routine that keeps the data with a flag so tell C# that new data has arrived.
Just for interest, would this be a good idea?
However, I will try as you suggest.
|
|
|
|
|
|
Hi folks,
I'm unable to convert code that works in MFC for Pocket PC (2003 using VisualStudio 2005 beta 2) to C#. The basic idea is to use the COM object for Pocket Internet Explorer to gain access to the HTMLDocument object.
In MFC this is done in the view class with something like (error handling removed for brevity)
m_wndBrowser.CreateControl(CLSID_Browser,
lpszWindowName,
WS_VISIBLE | WS_CHILD,
rectClient, this,
AFX_IDW_PANE_FIRST);
LPUNKNOWN lpUnk = m_wndBrowser.GetControlUnknown();
lpUnk->QueryInterface(IID_IBrowser, (void**) &m_pBrowserApp);
lpUnk->QueryInterface(IID_IBrowser2, (void**) &m_pBrowser2App);
...
But how to that in C# ? I checked MSDN (which directed me to use the Type Library Importer, but on what ? there is tlb or dll for PIE) and google but without success.
regards,
Tom
|
|
|
|
|
i need a long Image array of [300] images of 900x1100 pixel
i made it and it works...
but the access of it is slow in my application when i push a button i just use 5 images of this array and make just some modification, draw some line cut a part of the first, a part of the second and put all together.
It works slow becouse i use GDI+.
How can make it to works faster?
Can i use some faster memory area of my pc?
|
|
|
|
|
Loading 300 images, each 900x1100 in dimensions is gonna kill your memory usage. There's just no way to do this on a desktop PC, memory will shoot through the roof, dragging your system to a crawl.
So my first suggestion, don't load all 300 images into memory. Load the images you need, and call Dispose() on them when you're done. This should improve your performance (and memory usage) quite a bit.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
IF you're using 32bit color that's ~1.2gigs of data. Between application and OS level overhead, you'll probabably need at least 1.5gig of ram to keep the entire working set in memory at once. If your application needs to run on more modest machines you'll need to redesign your architecture to only load a fraction of the images at a given time. You could try storing the data in memory in a compressed format and only expanding the images as needed, you'll still have a fairly large ammount of overhead, but if you need the entire collection in working memory at once it would probably be better than thrashing the swapfile.
|
|
|
|
|
Hello
If you are trying to perform some image processing routines, then you should use LockBits and process your image using unsafe mode. It will be much faster, then using SetPixel /GetPixel .
But, as it was already said here, you need to avoid loading all 300 images. Even with unsafe mode it will be rather slow, because you will need much memory. And if you have no such much memory, then will lose performance on memory swapping.
With best regards,
Andrew
|
|
|
|
|
I am facing a problem with DirectPlay in C# is that
I want to simulate half duplex voice chating. Like whenever a person want to
talk, it press a button "Push to Talk". So, all other persons listen like in conference room. It means only one person can talk at one time. If someone press the button "Push to talk" while another talking, voice quality should be degrade.
Can i do this with TCPClient / TCPListener classses. If yes, how i can get audio stream from TCPClient object and how i playback.
Thanks Thanks Thanks in advance. Please help me urgently
Zeeshan
|
|
|
|
|
I'm a little fuzzy on this. How do I get a saved filed to display the same Icon/image as the application?
Thank you for you responses.
Jerry
"Art doesn't want to be familiar. It wants to astonish us. Or, in some cases, to enrage us. It wants to move us. To touch us. Not accommodate us, make us comfortable." -- Jamake Highwater
Toasty0.com
My Grandkids
|
|
|
|
|
Toasty0 wrote:
How do I get a saved filed to display the same Icon/image as the application?
You need to call SHGetFileInfo through P/Invoke. A perfect example can be found here[^].
|
|
|
|
|
Thanks Nick. I think I've figured out my problem. I have not actually installed the program on my development box so no file association or icon exists yet.
Thank you for your quick response to my question.
Jerry
"Art doesn't want to be familiar. It wants to astonish us. Or, in some cases, to enrage us. It wants to move us. To touch us. Not accommodate us, make us comfortable." -- Jamake Highwater
Toasty0.com
My Grandkids
|
|
|
|
|
Hi,
Would anyone know why creating an instance of a COM Object within a Windows Service would throw up a QueryInterface failed error?
Are there any special permissions required?
Thank you.
|
|
|
|
|
hi,
Does anyone know how can i view/get information about running application on my client pcs in my network through my network server? i want to get license information of the application. i also want to monitor the frequency of usage of the app. what are the things that i need to learn and consider in building such application? need your help and suggestions guys... thnx...
-batmanAgen-
|
|
|
|
|
Hi,
The description is a bit vague, so I'm not really sure what you're going for. If you are talking about writing your own network communication, read up on the multitude of ways to handle such things (web services, .NET remoting, direct TCP/IP communication, etc.).
Another possible solution is to use the performance counters available through Windows. Here's an MSDN search to get you started. http://search.microsoft.com/search/results.aspx?view=msdn&st=b&na=82&qu=performance+counters+c%23&s=1[^] You can also explore this by opening "Administrative Tools" from the "Control Panel", then selecting "Performance".
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Hi,
Does any one know where I can read a good article on the web.config file? I'm still stuck on my problem, and no-one can seem to help me. I can't seem to find a good article as well.
Let me describe my problem again.
My website has 2 login sections, namely:
wwwroot/members/login.aspx and
wwwroot/admin/login.aspx
Only members can access the members section, and only admin people can access the admin directory. Each section has it's own directory structure.
If someone tries to access a page in the members directory, then he/she should be directed to the /members/login.aspx page, and if he/she wants to access an admin page, then he/she is directed to /admin/login.aspx.
I'm not sure how to set this in the web config file, and if this is the best place to set it. I need this kind of info, and must the web.config file lie in wwwroot, or under /admin/, or under the /members/ section.
How do I modify my web.config file(s) to handle this.
Any online docs/books will be appreciate!!
I hope someonme can help!!
Regards,
Brendan
|
|
|
|
|
|
Hi guys & girls,
I've a problem with threads. I write a Windows Service which handles files. The processing can take some time, so I need to use threads, as some of the files have to be processes as fast and can not wait while other files are getting processed.
My application is designed as follows:
I've three modules. The first module reads and writes "internal" files. The third module reads and writes "external" files. The second modle converts the files, either internal or external, into the other format.
So when the first module gets a file, it gives an object representing the file to the second module, where the file is converted and then the second module gives the object to the third module where it is saved. For external files its the same, just the other way round.
So I thought about using either FileSystemWatcher or a Timer for checking for new files on both sides and then start a thread for each file. But with this the method calls will start in the first module and stop in the last.
So I thouhgt about a different approach. I could create some buffer between the modules and on each side of the buffer a thread looking for new files in the buffer. In the converter module, where the time consuming part takes place I could then start new threads for each file, but this threads would stay inside the module.
I just don't know which approach is better or maybe both of them are bullsh**, so could someone please give me some help with this? I want to create a clean application but I haven't worked much with threads and so I just don't know what would be better. With the second approach I could control the number of working threads better, but I'm just not shure if it is a good method, so please help me with that!
greetings
Stampede
-- modified at 9:20 Tuesday 6th September, 2005
|
|
|
|
|
Depending upon how many files you may be converting simultaneously, you could run into slower performance because of too many threads. So, the ideal solution would be to use a thread pool of some kind. And here, you're in luck! There is an easy-to-use thread pool built into the .NET Framework.
With no more information that what you've described, I would suggest that you do something similar to the converter-thread idea. Combine this with the built-in thread pool capabilities of the .NET Framework.
To do this, either create events in the first and third modules, having the converter subscribe to them. Or, create a delegate in the converter module, which the first and third modules can access. Then, instead of simply calling the delegate directly, use the BeginInvoke() method. (Also, make sure you handle things properly with EndInvoke when the callback is triggered. Otherwise, you can have leaks.) This method will use the built-in thread pool to execute the function used by the delegate!
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Both the system.timers.timer and the FileSystemWatcher fires events from the thread pool, so your first approach is going to be easier to code and maintain. You shouldn't have to create or manage threads at all in your app. Just write your event handlers like you normally would and concurrent events will be fired on seperate threads. The only thing you have to look out for is syncronization of shared resources.
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 know this isnt the appropriate place to post this but sice i see a large number of people using this forum, i decided to go ahead. I have a lot of code snipptets lying in my computer which i require regulary. Is there some of code management software. I once used to use Artifact Desktop a.k.a CodeJack but it was shut down. Anything similar?
|
|
|
|
|
Hi!
I have a big problem, my VS 2003 crach all the time.
In the loggbook I can see:
Faulting application devenv.exe, version 7.10.3077.0, faulting module ntdll.dll, version 5.1.2600.2180, fault address 0x00043345.
Serching on the net, I can understand that I am not the only one,
and somone was talking about a hotfix.
Is there anyone, who can help me???
Thanks
Benni Svensson
info@saw.se
|
|
|
|
|
I've created a sqldataadapter, stored procedures, and a data set using the VS2003 IDE Wizard based on a select command with a single paramter; search and updates work fine. I've got non-null columns in my database so I had to create a new Datarow in the data set and update that to perform an insert. The problem is the follow-up fill (sqlDataAdapter1.Update(dsStaffPhysicians1) to repopulate the dataset errors. Any help would be greatly appreciated.
Code Snippet Follows=================================================
static void Main()
{
Application.Run(new Form1());
}
private void menuItem2_Click(object sender, System.EventArgs e)
{
//Initialize Staff Physician Screen
SetupStaffPhysician();
menuItem2.Enabled = false;
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
//Exit Application
Application.Exit();
}
private void SetupStaffPhysician()
{
panel1.Visible = true;
this.comboBox1.DataBindings.Add(new System.Windows.Forms.Binding("SelectedIndex", this.dsStaffPhysicians1, "tblStaffPhysicians.docLicenseState"));
}
private void ClearStaffPhysicians()
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";
comboBox1.SelectedIndex = 0;
}
private void btnSearch_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.SelectCommand.Parameters["@Param2"].Value = textBox3.Text;
dsStaffPhysicians1.Clear();
sqlDataAdapter1.Fill(dsStaffPhysicians1);
}
private void btnReset_Click(object sender, System.EventArgs e)
{
this.dsStaffPhysicians1.Clear();
ClearStaffPhysicians();
}
private void btnUpdate_Click(object sender, System.EventArgs e)
{
this.BindingContext[dsStaffPhysicians1, "tblStaffPhysicians"].EndCurrentEdit();
sqlDataAdapter1.Update(dsStaffPhysicians1);
sqlDataAdapter1.Fill(dsStaffPhysicians1);
}
private void btnInsert_Click(object sender, System.EventArgs e)
{
try
{
ClearStaffPhysicians();
}
catch(Exception exp)
{
MessageBox.Show("Error 001 " + exp.Message);
}
}
private void btnCommit_Click(object sender, System.EventArgs e)
{
DataRow newStaffPhysician = dsStaffPhysicians1.Tables["tblStaffPhysicians"].NewRow();
newStaffPhysician["docLName"] = textBox3.Text;
newStaffPhysician["docFName"] = textBox1.Text;
newStaffPhysician["docMName"] = textBox2.Text;
newStaffPhysician["docLicenseState"] = comboBox1.SelectedIndex;
newStaffPhysician["docLicenseNumber"] = textBox4.Text;
newStaffPhysician["docUpin"] = textBox5.Text;
dsStaffPhysicians1.Tables["tblStaffPhysicians"].Rows.Add(newStaffPhysician);
sqlDataAdapter1.Update(dsStaffPhysicians1);
//Fill method will error!!
sqlDataAdapter1.Fill(dsStaffPhysicians1);
}
}
}
|
|
|
|
|
This may not fit with the parameters of your application design, but the examples show the Fill command being executed before the Update. (So you could move the Fill command to the top of your btnCommit_Click function.)
Also, for this type of problem, it is far more likely that you will get valuable help if you provide a detailed error message in your post.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Hi
I need to free the memory occupied by xml document.
I tried to use this code inside button
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("c:/a.xml");
you can check for memory performance in windows task manager
I have already made one project The problem is coming in this xml loading
every time its creatting own instance and incraeasing the memory.
If any one has any idea to free momory
if some one give me example of relasing momory
thanks
|
|
|
|
|
Could you explain the setup a little more? The .NET Framework's garbage collection usually handles these things quite nicely. Unless you are loading many XML documents and keeping references to them (so the garbage collector thinks you still need them), you shouldn't have any problems.
As a side note, if you are processing many XML documents, and using them in a read-only fashion. You can gain performance by using either XmlReader or XPathDocument. (I prefer XPathDocument.)
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|