|
Hi, does anyone know how to define a std::ifstream to be in a non-sharable mode.
In the ifstream for <fstream.h> the code is:
//deny read and write on somefile.txt
int fh = _sopen("somefile.txt", _O_CREAT, _SH_DENYRW, _S_IREAD);
istream ist(fh);
But how do you do this for std::ifstream?
THanks
Sharon
|
|
|
|
|
Hello,
I'm trying to create a C++ project that uses C# methods to connect to a database, collect information, and send that information back to the C++ portion. The C# also needs to accept an instance of the C++ class and use it to sort the information from the database. The main HAS to be in C++!
Creating a managed wrapper so a C++ class can be used by a C# program, i've done -- going backwards like this, I haven't! can someone tell me if what i'm proposing is possible? Any suggestions as to how i can tackle this problem would be greatly appreciated!
btw...in my research of this project, i keep coming across using "tlbexp.exe" to create a type library file from my C# class -- this sounds all very good, and i've located "tlbexp.exe" on my computer, but what exactly do I do with it?!??
my apologies in advance for my newbie-ness...
thanks
|
|
|
|
|
You could let your C# class expose an interface for COM and then use this COM object from C++.
Funny that you ask this question now, because just yesterday I've published a wizard to create a C# COM class very easily.
Take a look here (shameless self-advertisement )
Best regards,
mav
|
|
|
|
|
Thank you, actually the wizard was very helpful!
|
|
|
|
|
Fine
|
|
|
|
|
Hi.
My problem is if my program is using 10,000kb then i load a catalog in CDialog
<br />
OnBnClickedC()<br />
{<br />
CatDlg dlg;<br />
dlg.DoModal();<br />
}<br />
memory raises 18,000kb and when i close de dialog it returns to between 12,000 and 13,000kb
why?
how should i release the dialog?
i tried with new and delete with the same results.
Please help me.
Update:
i see that when i load the dialog, a lot of dlls load with it, but all dlls unload only when i exit the application not when i quit the dialog. Why?
|
|
|
|
|
Mr. Unknown wrote:
how should i release the dialog?
There's nothing to release. It's a stack-based object.
Read the last section of this article for clarification.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I plan to create an application which will be able to read all the request sent to a web server
for example, let's say a user send his username and password in PHP. and the url will be
"http://localhost/test.php?username=daron&password=12345"
at the same time, a C++ application is opened all the time and connected to the web server
once it detects there is any requrest from the web server, it will 'catch' the url and write it to a text file
the problem is, i read through the WinINet class and found out it does not support such function
(or maybe i was wrong bout it)
please help...
|
|
|
|
|
You need raw sockets... Well I needed one for making an application which was getting all the sites I was connected ( including those advertisements). You can find a good article on it on codeguru (and maybe here because people writing articles post them in both sites) it is named "Sppeding up internet connection".
Well... I am a beginner ...
|
|
|
|
|
I wonder if there is someone out there who have made a CSG-class-library or seen something like that.
_____________________________
...and justice for all
APe
|
|
|
|
|
I created a crude version of this during some CG course at university. The classes were designed for raytracing, so they worked with line segments and handled returning of closest intersection point in a CSG scene graph.
If you are looking for CSG operations for a mesh you'll have to first develop something like the Winged-Edge data structure or the Half-Edge datastructure before developing CSG operations for a mesh.
|
|
|
|
|
ahmadkabani wrote:
I created a crude version of this
My I have a look att what you did (or parts of it) to make my brin start to work
_____________________________
...and justice for all
APe
|
|
|
|
|
Hope somone can help. ANY OTHER SUGGESTIONS???? THANKS -
I have an app out on remote PCs running win 98 (ug). Some of these machines can not be restarted (Infinite shutdown message). Tried everything to fix the actual problem within Win98 but to no avail.
I added some code that would reboot the system based upon some predefine logic (has not communicated with HQ in x hrs. I use EWX_REBOOT but this tries to do a smooth shutdown. Again on some of the remote PCs the system hangs on the shutdown screen. I also tried variations with EWX_FORCE, EWX_SHUTDOWN.
I believe that the safest bet for me is to do a hard reboot, simulating lose of power. Not the best thing to do but I see no other solution.
Any help will be appreciated.
Thanks
TomH
|
|
|
|
|
|
Thanks and yes I am aware of the shutdown issue. I have applied this patch before and run through what they recommend. It still does not work consistantly. Would perfer a programable approach.
TomH
|
|
|
|
|
Ouenstreet wrote:
I also tried variations with EWX_FORCE, EWX_SHUTDOWN.
Did you terminate the Explorer process first?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
No I did not. and I don't know how to.
Thanks
TomH
TomH
|
|
|
|
|
See if this search helps.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
David,
Thanks. Found out how to close processes. I tried shutting down Explorer and then issued the reboot but it did not work. The system still goes to the "Shutting Down... " screen.. forever.
FYI
My order of execution is
Kill the Explorer
EWX_REBOOT
PostMessage(WM_CLOSE)
I am surprized that in all the years and problems with win98 not shutting down that someone hasn't developed a 'Hard Reset'.
If you can come up with anything else it would be great.
TomH
TomH
|
|
|
|
|
Ouenstreet wrote:
PostMessage(WM_CLOSE)
What window are you posting this message to (after ExitWindowsEx() has been called)?
Ouenstreet wrote:
If you can come up with anything else it would be great.
Do these machines shut down normally at all, or is it just when you try to do it programmatically?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Some background. I have 30 PCs in the field just a few don't restart programmatically or by Hand (Start, shutdown Restart).
Have tried all the troubleshooting on shutdown to fix.
Not sure about your other question.
The actual code reads:
kill_proc() ; // kill explorer process- added at you recommendation.
ExitWindowsEx(EWX_REBOOT,NULL);
PostMessage(WM_CLOSE,0,0);
TomH
|
|
|
|
|
Can anyone tell me how to disable the desktop properties (right click on desktop).
|
|
|
|
|
I don't know the answer ( well if there is a really easy way ) but you can try mouse hooks.
Well... I am a beginner ...
|
|
|
|
|
In the registry, set the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoDispCPL value to 1.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
i have created sysutil for that,it will going to published on cp today so wait till tommorow
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|