|
I want the source code with C#.
that link contain only executable file.
So can u advice me something else ?
thanks in advance
Mann Khine.
|
|
|
|
|
|
|
Hello,
As I'm programming in good old C, Win32 API, I'm looking for the equivalent of the OpenFileDialog().
What I'm looking for is the replacement of
OpenFileDialog openFileDialog1 = new OpenFileDialog();
By something like
DialogBox(hinst, "MyBoxDB", hwnd, (DLGPROC) DialogFunc);
or
hHelp = CreateDialog(hinst, "HelpDB", hwnd, (DLGPROC) HelpFunc);
ShowWindow(hHelp, SW_SHOW);
I'm not using any visual devellopment environments. Just a texteditor, a resource compiler and g++.
A static library, containing something like the OpenFileDialog(), would also be nice. As long as it's possible to implement it in a plain C program. As I'm using g++ in stead of gcc, It's no problem to make use of C++.
The guys from MS didn't cooperate; maybe someone in here knows the answer?
Thank you,
Frits aka TWW
|
|
|
|
|
Do you think the C# forum is the correct place for this question?
Anyway, the OpenFileDialog is basically a wrapper around the open file dialog in the commdlg.dll , so it could be a good idea to investigate into the GetOpenFileName() export of this dll.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
The problem is that my question has to do both with C# and C. It's always in between two languages.
Should a question about the translation form an English word to a Dutch word be posted on English or a Dutch forum?
At least I’ve now got a direction where I can look.
Thank you very much.
Regards,
TWW
|
|
|
|
|
Problem is solved!
Link against comdlg32.lib
The stuff like
openFileDialog1.InitialDirectory = "c:\\";<br />
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";<br />
openFileDialog1.FilterIndex = 2;<br />
openFileDialog1.RestoreDirectory = true;
Is "translated" into something like
OPENFILENAME browse;<br />
char szFile[260];<br />
ZeroMemory(&browse, sizeof(browse));<br />
browse.lStructSize = sizeof(browse);<br />
browse.hwndOwner = hwnd;<br />
browse.lpstrFile = szFile;<br />
browse.lpstrFile[0] = '\0';<br />
browse.nMaxFile = sizeof(szFile);<br />
browse.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";<br />
browse.nFilterIndex = 1;<br />
browse.lpstrFileTitle = NULL;<br />
browse.nMaxFileTitle = 0;<br />
browse.lpstrInitialDir = NULL;<br />
browse.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
And the function call
if (openFileDialog1.ShowDialog() == DialogResult.OK)
is "translated" into
if (GetOpenFileName(&browse)==TRUE)
Regards,
TWW
It's just finding the right words and the result is the same.
|
|
|
|
|
our group need to finish a project to record the incoming packets in the gateway and assemble these packets into binaries. Once we have the binary, and send it to the sample collection server, where it will undergo further analysis.how should i start with c#?can anyone help us,thanks a lot!
|
|
|
|
|
I can instantiate a COM object in VC++ without any problem.
But when i call one function exported by the COM object i
get this exception.
Error details :
Exception Details: System.Runtime.InteropServices.COMException: The server threw an exception.
Source Error:
Line 28: //System.Windows.Forms.Message.Create(
Line 29: string s = "SKULM/STEVEN ABCDEF 1A 01101401JFKXXXXXXXXLHRCO 1234 140Y 03A 62 01 100512345678900 CO1234567890 Yaaa";
Line 30: obj.Create2dBarcode(ref s);
Line 31:
Line 32: // Put user code to initialize the page here
Source File: d:\inetpub\wwwroot\test_barcode_cs\webform1.aspx.cs Line: 30
Stack Trace:
[COMException (0x80010105): The server threw an exception.]
final.HelloBitmpClass.Create2dBarcode(String& str) +0
Test_Barcode_CS.WebForm1.Page_Load(Object sender, EventArgs e) in d:\inetpub\wwwroot\test_barcode_cs\webform1.aspx.cs:30
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
|
|
|
|
|
I think the most common problems when using COM objects in an ASP.NET environment are security-related.
You can use the method without problems when you write a test application because this test application is executed under your user account.
Your webform (and thus all COM objects you create/use there) is usually executed under the ASPNET account, so the COM object might not behave as expected.
Check you COM class if it has access to everything it needs, even if it's not executed under your user account.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I have a problem where I'm developing a WinForms application. I have one set of controls, eg., accepting user details that I need to show on all my forms.
What would be the easiest way to club all these related controls into a class, and show it on all pages by just doing a Form.Add control or something like that?
TIA,
Jaffar
|
|
|
|
|
Hi
You could create a UserControl with the common elements on it, then just add this control to your forms.
----------------------------
Be excellent to each other
|
|
|
|
|
That was what I initially thought.
Unfortunately, there I was stumped with sharing database connections with the user controls. Would this be simple to do?
Regards,
--Jaffar
|
|
|
|
|
jaffarkazi wrote: I was stumped with sharing database connections with the user controls. Would this be simple to do?
You wouldn't want to do that anyway.
Your user control will expose a bunch of property gets and sets to broker access to the data being displayed. Once some action on the form (where the user control resides) is taken, like an "OK" button press, you should read the user control properties (which will probably just read the .Text property of the textboxes on the control), use that data to populate a business object which you will pass to your data layer, which knows how to talk to your database.
Your user control shouldn't be talking to your database, if you want to do proper tiered development...
Share and enjoy.
Sean
|
|
|
|
|
I have just made a server- client program (TCP socket). The server program is run as a windows service. Firstly, the client will connect to server and send the command to server, then the server will check the command from client and reply client if it is a right command. Is there some ways that send a wrong data from client to server and break the server ?
|
|
|
|
|
I have programmed my own MessageBox class. I want my messageBox to show have FOrmBorderStyle = Fixed3d but without the title bar, how can i do this?
|
|
|
|
|
To show form without title you have to set ControlBox property to false and Text property to ""
Hope it help.
____________________________________________
Robin Panther http://www.robinland.com
|
|
|
|
|
hi,
I'm coding an add-in for some debug information, now I want my add-in capture the event when a break point is added by the programmer. How can I do this?
Thanks in advance!
|
|
|
|
|
I need to add a registry key for my service (DependOnService) and would like to add it in the deployment project using the registry view. however, the only choice for a string is 'REG_SZ'. DependOnService is supposed to be of type 'REG_MULTI_SZ'. Is there any way to do this in the ide without having to use the AfterInstall event and actually update the registry with the correct value type?
Some Pictures[^]
BugReporter[^]
BlackDice
|
|
|
|
|
you add a regular string value and put "[~]" between your string values and it will be added to the registry as a REG_MULTI_SZ value. In my case I only added one value, then still put {~] after it and it recognized it correctly.
Some Pictures[^]
BugReporter[^]
BlackDice
|
|
|
|
|
Hi,
Does anyone know of a Visual C# example that demonstrates displaying an XML file, using XSL, displaying the data, specifically a short document that might run for a few pages, in a standalone app? By that I mean the XML and XSL files would be resident on the Pocket PC (and a PC version would be nice, but I assume I could retrofit from the former to the latter) and not have to be accessed through the Internet.
Thanx in advance.
Derek
|
|
|
|
|
Hi,
In my WinForm App, I have a blocking call to dll that takes a while to return. I want to indicate the user to wait, probably by showing an animated gif or progress bar.
I dont want to go into threading. Is there any other way to do this.
I created another form that looks like small dialog with the animated gif and text box.I changed the FormBorderStyle property to FixedDialog.
I called it from my form as
<br />
WaitDialog WaitD = new WaitDialog(this); <br />
WaitD.Show();<br />
<br />
<br />
<br />
WaitD.Dispose();<br />
What happens is, it shows the wait form, but none of its controls ( the animated gif and text box) is shown. I get a blank white boxes in their places.
What should I do. Any ideas.
Thanks in advance.
-- modified at 15:10 Tuesday 28th February, 2006
|
|
|
|
|
Manu_81 wrote: a while to return. I want t
A blocking call is a blocking call, there's really no way around this. Once your UI thread makes the blocking call to your dll, you're stuck in that you cannot update your form. You *could* pass your form instance into the blocking call, and have the blocking call call form.Update or Application.DoEvents(), but that's sounding more like a hack than anything.
What's wrong with threading for this?
|
|
|
|
|
Apart from the blocking call, I also call various other functions from the dll and display the return results to the user. So if I do thread, that would be like updating the UI inside this thread, which I dont want to do.
I also want to avoid thread for this, as my app uses some threads in different places. I just dont want to use so many threads in my app...
So there is no way to get around this???
-- modified at 15:49 Tuesday 28th February, 2006
|
|
|
|
|
Manu_81 wrote: I just dont want to use so many threads in my app...
Threads are a good thing. They allow you to utilize multi-core and multi-processor machines far more than a single-threaded application would. They also keep your UI thread responsive, which end-users will praise you for.
I recommend that your DLL do its heavy lifting on another thread. While that thread is running, have the dll just display a "loading..." or "please wait..." dialog of some kind. Then, when the thread is finished, return the results to the UI thread for display to the user.
You can use the BackgroundWorker[^] class to help you do this in a simple manner.
The only other option would be to make a call to .Update() your form from your dll or call Application.DoEvents. However, there are caveats and gotchas associated with those solutions; the best solution is to do heavy lifting on a background thread.
|
|
|
|