|
Have you tried running it in the debugger? Once you close the handles then your program is not really doing anything else, and so a segmentation should be hard to achieve. As an aside, the code isnt the easiest to read as presented, but it does seem to be a mix of Win32 and Unix - which is it meant to be? Additionally, you dont need to do '&*rbuf' - rbuf will do!
|
|
|
|
|
Thanks. Actually, I had figured it out; I've been so warped by using Visual Basic that I was attempting to allocate a char * like a VB string.
|
|
|
|
|
This looks suspiciously like a l*nux question to me...
[fx: dredges up memories of working with genuine UN*X code]
You don't have a definition shown anywhere for rbuf, wbuf or irbuf/iwbuf.
I'm assuming that the first two are char [somenumber] and the latter are int's.
You don't need &* in the read or write calls, unless your compiler is crazy.
Are you certain that the buffers are large enough? That would cause a segmentation fault.
The illegal seek is being reported once, and then you're not resetting errno, so it will keep being reported.
Hope that helps a bit.
Steve S
|
|
|
|
|
I'm writing a plain Win32 dialog app with a big video window and a few basic controls. I want to implement keyboard shortcuts, but I've run across some problems: the controls take the focus away from the main window, so using WM_KEYPRESS doesn't work if the user has the focus on one of the controls. I then tried using accelerator tables; they work fine for VK_XXX keys, but using ASCII alphanumerical keys seem to send the message twice sometimes. Any ideas?
Thanks!
|
|
|
|
|
Hello everybody,
I was wondering if anybody had some experience with this.
I work in Visual Studio 6.0 and a range of libraries for specific engineering work.
You know how intellisense helps you with functions and variables for the standard libraries.
Is there any way one can extend intellisense capability to include other libraries that are being used in the project? Let me know
Any help would be appreciated.
thanks
|
|
|
|
|
Add the other projects to your workspace.
|
|
|
|
|
hi
anyone can help me , how can i open and read a PS/2 port (that not opened with windows and is close)?
thanks
|
|
|
|
|
hi
anyone can help me , how can i open and read a PS/2 port (that not opened with windows and is close)?
thanks
|
|
|
|
|
Ok, this is bugging me.
Say i have this dir:
test
folder1
hello
goodbye
folder2
hello
goodbye
Those are all folders. Now, say i want to delete all folders called 'hello'. How would i do this? I tried piping a dir command into the del command:
dir /A: D /s hello | del
but that didnt work. any one got a tip?
*.*
cin >> knowledge;
|
|
|
|
|
try piping it to a rmdir command. I have not tried it myself.
|
|
|
|
|
it said the syntax was incorrect
*.*
cin >> knowledge;
|
|
|
|
|
This will work.
for /R %i in (hello) DO rd %i
If you are new to DOS, believe it or not, it is a DOS command.
|
|
|
|
|
I thought /R was an NT CMD.EXE thing...
Steve S
|
|
|
|
|
i don't think you can do that in ms-dos.
|
|
|
|
|
well, im using XP's cmd.exe, and im still not having any luck. :-/
*.*
cin >> knowledge;
|
|
|
|
|
Because I miss the point where I can enter the OnInitDialog function on a dialog in .Net2003,
so I tried to use WM_SHOW_WINDOW on this dialog.
When the dialog was called via DoModal() I saw that the OnShowWindow function
was called twice with parameter bShow = TRUE.
Is this a bug or am I missing the point?
|
|
|
|
|
Isn't it possible to create the OnInitDialog function via using the property view of a dialog.
I only see other WM_ Messages.
Am I searching in the wrong place or will this function be replaced and shouldn't be used anymore?
Hope someone can help.
|
|
|
|
|
OnInitDialog isn't actually a regular message handler in MFC (this has been true since at least version 4.2) but is instead a virtual function that you can override. You'll find it in the overrides tab of the Properties window.
Aside: why the hell is this here? Why can't I right-click a class and choose Add Windows Message Handler like in VC 6? That made sense...
|
|
|
|
|
Thanks for this satisfying answer. Yes I think you're right that this important function has to be reached more simple.
|
|
|
|
|
How can I set a Font to a CWnd object with SetFont ?? I try with method GetLogFont, but I don't know how to build a LOGFONT object. Please if you could give me an example... (For Example: Tahoma, size 12).Thank you.
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
Try this:
<br />
CFont tahomaFont;<br />
<br />
tahomaFont.CreatePointFont(120, "Tahoma");
YourCWndObject.SetFont(&tahomaFont);<br />
That should work. A really good idea is to store your font objects as member variables of a class so you can clean up after yourself at the destructor phase.
Hope this helps
www.kinkycode.com
[Glossary Manager] [AfterThought Backup Lite]
99 little bugs in the code, 99 little bugs,
Fix 1 bug, recompile....
101 little bugs in the code...
|
|
|
|
|
Thank you so much, it was very helfully. It sent me an assert error, but I solved it with:
<br />
CFont* my_font = new CFont;<br />
<br />
my_font->CreatePointFont(120, "Tahoma");<br />
Thank you so much !!
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
I have been asked to write some sort of media streaming application to work over a network i.e. client / server to demonstrate the various quality of service mechanisms avaliable via the winsock2 gqos api but i've no idea what the best way to go about this would be. Any suggestions, or ideas would be greatly appriciated as to the possible structure of such a program. Cheers.
|
|
|
|
|
Hey guys, thanks in advance for checking this out and would like to apologize in advance considering we still have fairly little direction with this project. On that note: we're making an inventory program, with a client computer updating a database of some kind on the server through a network of some kind.
Now the questions: What network type do you guys think would be best - ADO, DCOM, RPC etc.?
What databasing system do you think would be best? This project is still in its initial phases so let your imagination run wild.
Oh as far as user input, considering the large amount of input that will need to be catalogued, we were considering XML or MFC rather than DOS input.;)
Sorry, feel free to give your input and we'll clarify exactly what were looking for later. Thx in advance.
|
|
|
|
|