|
Hi,
I am developing a program that needs to read a text file to the user. Could anybody tell me where I can find such a open source program or API? Thanks
|
|
|
|
|
Use the Speech SDK.
A tutorial on it can be found at:
http://www.ltpb.8m.com/tutorial/Listall.html[^] (i forgot the direct url, but this is the list)
-Steven
CP.Lounge.Addicts+="Steven";
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|
|
I'm having trouble linking to a DLL that I've made. I have a project that uses multiple DLLs that we've created in house. Everything uses this one DLL that's has the most commonly used classes. Amazingly enough it's called common.dll. Anyway I'm having trouble linking to it in one of the other dlls. The signature that it gives in the error is ?StartServiceA@CTcpClient@@UAEHXZ. BUT the signature in the mapfile of common.dll and according to dependency walker is ?StartService@CTcpClient@@UAEHXZ. Common.dll as well as the CTcpClient class inside of it is used in many other things. They all link fine. One other note of interest. This linking error only happens when CTcpClient is created dynamically. If I create it using CTcpClient newClient(blah,blah,blah) all works. Thanks for the help.
Here's the full linking error.
Linking...
Creating library ..\..\..\lib/NetTraffic.lib and object ..\..\..\lib/NetTraffic.exp
ClientInterface.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CTcpClient::StartServiceA(void)" (?StartServiceA@CTcpClient@@UAEHXZ)
..\..\..\lib/NetTraffic.dll : fatal error LNK1120: 1 unresolved externals
nay
|
|
|
|
|
A few questions to the wise:
1) If I call strdup for a pointer to a string which is a member of class do I need to call free before recalling?
eg. cMyClass.szString = strdup(szString1);
cMyClass.szString = strdup(szString2);
Does the above cause a memory leak if I don't use free(cMyClass.szString); before the second call to strdup?
2) In a similar case if I am using strdup but there are pointer to class as in a linked list and I use delete to delete the pointer does that also free the memory taken up by strdup or I would have to free that memory first and then call delete on the pointer?
|
|
|
|
|
1) Yes
2) Yes
strdup() does always allocate a new copy of the string.
Therefor you must always free the the memory "manually".
"You can stand all night at a redlight anywhere in town, hailing Marys left and right but none of them slow down. I've seen the best of men go past. I don't wanna be the last..."
|
|
|
|
|
For the second question you mean yes as in called free first on all objects of the pointer to class and then call delete or just delete will clean up everything? Thanks.
|
|
|
|
|
Sorry, didn't read #2 well enough...
You should use
<br />
if(m_lpszString != NULL)<br />
{<br />
free(m_lpszString);<br />
}<br />
in the destructor of the class
The basic rule is:
If you ever call strdup(), you must free() it somewhere.
A better alternative is to use a string class, either MFC or STL.
"You can stand all night at a redlight anywhere in town, hailing Marys left and right but none of them slow down. I've seen the best of men go past. I don't wanna be the last..."
|
|
|
|
|
Ok, I understand now, thanks.
|
|
|
|
|
hi
i have an empty document. and i draw some line and image in it, even i minimize and then maximize the window, all of the document window content will be cleaned. how can i stop this ? i think i sould Invalidate() it but how can i findout that the window in minimized (or even window goes under another windows it will be cleand)
thnx anyway
|
|
|
|
|
HellShrimp4free wrote:
how can i stop this ?
You can't. It's by design. How else can it work ?
HellShrimp4free wrote:
i think i sould Invalidate() it
It invalidates itself, the problem is that you're not doing your drawing in the OnPaint or OnDraw or OnEraseBackground message handlers, which means that it's not redrawn when the Invalidate occurs.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
thanks mr christian. i write the drawing code in OnPaint and the content saved. So it mean that it will redrawn itself when needed and i don't have to check for redrawn opearation?
my another question is : in a sample in MSDN it loads and shows a Bitmap from a .bmp file. is there any way to load bitmaps from Resources ? (for Emxaple IDB_BITMAP1)
in GDI+ i mean.
|
|
|
|
|
HellShrimp4free wrote:
is there any way to load bitmaps from Resources ?
Look up the LoadBitmap() API.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
HellShrimp4free wrote:
So it mean that it will redrawn itself when needed and i don't have to check for redrawn opearation?
Yes.
HellShrimp4free wrote:
in GDI+ i mean
I believe that you can build a Bitmap from a HBITMAP, which is probably the way to go.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi:
am new to Visual C++ and have found www.codeproject.com to be an invaluable resource.
Can anyone please advise me on how to find out what version of the Windows SDK is installed and if needs to be upgraded.
Am currently running VC++ 6 SP5 on Win XP Prof.
Thanks in advance for any help.
Martin
|
|
|
|
|
If you haven't installed any of the actual Platform SDK's, then you are using the (very old) headers supplied with VC6. If you do have one or more versions of the SDK's installed, there should be a 'readme' file (usually found in <program files>\Microsoft SDK\readme.htm) that will include the date of the SDK.
For the latest SDK, see the MSDN[^]. I highly recommend buying a subscription, since it gets you the MSDN library and all of the SDK's on CD, as well as opens up download areas on the MSDN site.
Software Zen: delete this;
|
|
|
|
|
Gary:
thank you for the response.
Looks like I'm currently using the headers supplied with VC6.
Will look into a MSDN subscription as you advised.
Thanks,
|
|
|
|
|
|
Thanks:
but a bit large for a dial up connection.
Martin
|
|
|
|
|
Hi !
I have a homework about placing bitmaps on menus. In fact it is menu elements made of bitmaps entirely (Like in the Petsholts' book). If anyone could show me a sourcecode for this I would be greatfull;
(Both Mfc and c source acceptable)
Thanks.
|
|
|
|
|
The folks at Code Project don't mind helping with homework assignments, but you need to at least try to do it yourself first. You've apparently seen some source code (e.g. your reference to Petzold's* book), so you at least have an idea of what you need to do. Get the project started, and if you get stuck with a specific problem, feel free to ask.
* Note how the man's name is spelled
Software Zen: delete this;
|
|
|
|
|
I've tryed to find information and/or codesamples om how to create binary registry key/value, but with no luck.
Yes, I'm a newbie! But I'm trying...
All I've found so far, is information and codesamples on how to create strings and dword registry entries. I've tryed to study the MSDN help as well. But with my level of VC++ knowledge, this is quite cryptic for me.
Is there any savior out there that could just give me a short sample on how to create binary registry key. For example:
Create:
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Test
Value(hex): a4,9d,bd,32,84,95,cb,01,fa,98,6d,5d
Best regards,
Peter
|
|
|
|
|
Try the following:
RegSetValueEx(key,name,0,REG_BINARY,data,data_size)
where key is the registry key you want to write, name is the name of the value, REG_BINARY indicates a binary value, data is a pointer to the data, and data_size is the size of the data in bytes.
Software Zen: delete this;
|
|
|
|
|
Cheers!
I'll try that. Thanks a lot.
Peter
|
|
|
|
|
hai,
We customized the default open dialog by deriving the class from
cfiledialog . These are the issues that we faced.
Issues:
1. How to handle the default messages in cfiledialog class?
2. In Win'2000 & above, we tried to change the listview style to
LVS_REPORT using Modifystyle method The style is changed, but the files and
column headers are not displayed.
3. In Win'98, how to remove the separator in toolbarwindow32.
Please give me the solution as early as possible.
sureshb
|
|
|
|
|
1. How to handle the default messages in cfiledialog class?
Make a new class inherited from CFileDialog, that would solve.
2. In Win'2000 & above, we tried to change the listview style to
LVS_REPORT using Modifystyle method The style is changed, but the files and
column headers are not displayed.
Call the member function InsertColumn(...).
And 3.... I dont know...
Maxwell Chen
Lets make bugs better!
|
|
|
|