|
Cheers, Thanks for the help.
Paddy.
|
|
|
|
|
As long as you don't use any managed C++ code, a VC7 program will run on all versions of Windows.
Michael
"I've died for a living in the movies and tv.
But the hardest thing I'll ever do is watch my leading ladies,
Kiss some other guy while I'm bandaging my knee."
-- The Unknown Stuntman
|
|
|
|
|
It should, but keep this in mind:
1. Don't use any managed extensions - these require the .NET runtime. This can be installed on NT, though, but it's too new to be there by default.
2. Statically link to the MFC and Visual libraries. Otherwise, you may find the required DLL's do not exist on an NT system, and would have to be installed.
Even a broken clock is right twice a day.
|
|
|
|
|
I am loading information from a inf file and modifying the window based on this. I have got most of it working except a few problems. The first being I load a 'title' into a CString and try to set the cs.lpszName equal to it, but it shows up with each character being a Ý. I'm thinking that a CString might be the wrong data type but I don't get any errors saying so.
Thanks for any info,
Steve
|
|
|
|
|
Perhaps you're doing
strcpy (cs.lpszName, myString);
Try:
cs.lpszName = myString.GetBuffer(0);
...;
myString.ReleaseBuffer();
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I guess you're using a CString defined locally within your overriden PreCreateWindow , right? If so, try using a CString defined instead as a member of your class.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That did it, thanks. How about this, my project is based on the CHtmlView. Do you know how to get rid of the vertical scroll bar? At first I thought it would be in the PreCreateWindow there, but I could not find any parameters to adjust that.
Thanks again for your help,
Steve
|
|
|
|
|
How do i get the path to my Win32 program? I've tried looking at the lpCmdLine argument in the WinMain function but there's nothing in it.
Thanks
|
|
|
|
|
Look at GetModuleFileName. It will give you the full path with the filename and extension.
|
|
|
|
|
How do I draw a rubberband that looks similar to the one of a CSplitterWnd ? thanks for help!
|
|
|
|
|
I am writing a desktop-based toolbar app ( similar in design to the IE Channel Bar ) written from a App-Wizard Generated C++/MFC Dialog Project that is designed to fade down to 25% opacity when it's not being used. It's intended to do this after processing the WM_KILLFOCUS message via the OnKillFocus() Dialog Member. Additionally, it should fade it's opacity back up to 100% when it recieves the WM_SETFOCUS message via the OnSetFocus() Dialog Member. My problem is that I'm unable to get any sort of transparency to work in this situation, including the articles I've seen here at CP or the MSDN . I've thought about using AnimateWindow() but to my knowledge that only fades the window out completely or in completely, and on top of that I don't know how to implement it. If some one could provide me with a code sample that demonstrates how I could apply transparancy in this situation I would be greatly appreciative. Thanks in advance.
It's good to see kids turning their minds to wholesum activities such as programming, instead of wasting their lives in the hedonistic disciplines of Sex, Drugs, & Rock & Roll... or Sex with Drugs, or Sex with Rocks while Rolling in Drugs, or whatever new-fangled perversions you little monsters have thought up now...
[Shog9 on Kid Programmers]
|
|
|
|
|
If you haven't already seen it, this[^] article may help.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Who knows clearly about Text To Speech SDK 5.0 ? Help me ! I heard that SDK 5.0 can deal with international pronunciation. Really (I have just began to use it today)?
Email me: dlhson2001@yahoo.com
|
|
|
|
|
know that I need to use WNetAddConnection2 to map a network resource but when I use WNetCancelConnection, and then try to map again I get an error 1312. I noticed that I can use WNetUseConnection to make my mapping but how do I disconnect a mapped resource on my pc? Thanks
Tom Wright
Programmer
tawright915@yahoo.com
|
|
|
|
|
How do I determine whether to use regular sockets or overlapped sockets? If I only have three or more connections connecting to my server (which I'm writing)at a time.
If I make this a multi threaded application then would I need to have events telling me that a client wants to connect?
How do I set the socket handle globally in MFC, without sticking it in my header file? So that I can pass it from one function to another...example
Handle is created in my OnOk function, how do I pass it to my OnCancel function to close the handle?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
How do I determine whether to use regular sockets or overlapped sockets? If I only have three or more connections connecting to my server (which I'm writing)at a time.
what flavour you prefer. should be good for a first start.
How do I set the socket handle globally in MFC, without sticking it in my header file? So that I can pass it from one function to another...example
make it a member variable in your class or pass it to function you call.
|
|
|
|
|
You would be better off making the socket a member of the class, in which you hanle your communication functions. You can use overlapped writes and reads, if you use an IOCompletionPort or WaitForMultipleObjects, so that you get notified of network events based on your pending reads/writes.
The easiest would be to have a lokk at an article here on CP by Norm Almond about creating scalable socket servers. A look at the article could give you ideas on implementing a multi-threaded server or client. If you cannot tie the code to NT, you will have to use WaitForMultipleObjects instead of the IOCompletion port
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
hi..
I want to change text color of RichEdit but this code didnt work.
void ChangeColor(HWND hWnd)
{
CHOOSECOLOR cc;
static COLORREF acrCustClr[16];
COLORREF cResult;
CHARFORMAT2 cf;
cc.lStructSize=sizeof(cc);
cc.hwndOwner=hWnd;
cc.rgbResult=cResult;
cc.lpCustColors = (LPDWORD) acrCustClr;
cc.Flags=CC_FULLOPEN|CC_RGBINIT|CC_ANYCOLOR;
if(ChooseColor(&cc)==IDOK)
{
cf.crTextColor=cc.rgbResult;
SendDlgItemMessage(hWnd,IDC_REDIT1,EM_SETCHARFORMAT,SCF_ALL,(LPARAM)&cf);
}
}
|
|
|
|
|
I want to insert "{" to the top of exist text file and insert "}" to the bottom of text file
Example:
If in "1.txt" has this data in it.
1234afd
daf845
dfdfa
and I want to insert "{" to the top of text file and insert "}" to the bottom of text file. So I think it should be like this
{
1234afd
daf845
dfdfa
}
I write program to do that. But my program replace "{" to the first line data of "1.txt"
So my program write this data in "1.txt"
{
daf845
dfdfa
}
Below is my program.
<br />
CStdioFile OutputFile;<br />
CString outp_filename, m_string; <br />
CFileException FileExc;<br />
BOOL bEnd;<br />
<br />
outp_filename = "1.txt";<br />
<br />
if (!OutputFile.Open(outp_filename, CFile::modeCreate | CFile::modeWrite | CFile::modeNoTruncate, &FileExc)) <br />
{<br />
FileExc.ReportError();<br />
return;<br />
}<br />
OutputFile.SeekToBegin();<br />
<br />
m_string = "{";<br />
<br />
OutputFile.WriteString(m_string+'\n'); <br />
<br />
OutputFile.SeekToEnd();<br />
<br />
m_string = "}";<br />
<br />
OutputFile.WriteString(m_string+'\n');<br />
<br />
OutputFile.Close();<br />
<br />
}<br />
<br />
Do you know how to solve my problem?
Thank you very much.
|
|
|
|
|
You will have to write the { followed by the regular text and the a } to a new file, delete the old one and rename the new one.
You can't append to the start of a file unfortunately.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
I have a console socket server, that takes user commands on the cin and displays some output on cout. The commsnds are basically performance statistics like messages processed, users connected etc. There are also commands to logout a user.
The server is cross platform and can be compiled on both Windows and Linux. The Windows compiled version allows me to run it as a service. Now, I want to run this as a service.
The question: Is there some application that can redriect cin and cout to a socket connection? Like I invoke my console app from this application and it provides a remote console to me, giving me exactly the same behaviour as the console.
If not, is there any technique to hook into cin and cout from an external application. I do not want to make any changes in the server. It is in production and extermely stable. I do not want to change it.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
program > mysockprogram
There you would handle any STDIN input from the incoming program.
In Win32, you can use GetStdHandle()[^] to get the handle to STD_OUTPUT_HANDLE and optionally STD_INPUT_HANDLE , duplicate them, and use Read/WriteFile() to get input/output from a standard handle pipe(s). There's a good example, Creating a Child Process with Redirected Input and Output[^] on MSDN.
"The greatest danger to humanity is humanity without an open mind." - Ian Mariano
http://www.ian-space.com/
|
|
|
|
|
I want to write a small app that encodes / decodes mp3 into wav format,
All i can find is tons of info about codecs, acm , etc...
Is there any way to write an mp3 codec so one does not have to worry about it already being installed. I can find no good information about this topic, windows media sdk seems to only really care about .wma files.
|
|
|
|
|
In addition say i use windows media sdk for mp3 decode/encode, does it come default on win 95 - xp?
and do i still have to pay the insane fees to mp3licensing.com?
|
|
|
|
|
nlecren wrote:
Is there any way to write an mp3 codec so one does not have to worry about it already being installed
If you write your own codec, you'll have a unique global id, so you don't need to bother what's already installed.
nlecren wrote:
windows media sdk seems to only really care about .wma files.
Looks like you don't know what you are willing to do. You just said you didn't want to bother what was already installed, and now you are talking about a MS product with ramification at the very core of the operating system.
You need to write a windows-compliant codec, that takes MP3 as an input, and output WAVs files. Get your hands on the Windows DDK.
Quite honestly, I would be you, I wouldn't do this at all. Writing codec stuff is very hard, because if you want reliable features, you need a lot of time, and you need a large background as a professional programmer. I don't know why instead you wouldn't get some free source code on the net (check out virtual dub for instance). But now, what would do with this code if it already produces WAV streams from MP3 ?
How low can you go ? (MS rant)
|
|
|
|