|
I have a sound data in array of 1MB ,
how can i send it through CSocket class ...
Is there any type ast needed.. if yes then how.
will it loose data or not..
thanx
|
|
|
|
|
Check out this link for a reference to the API.
To answer your question, if you create the socket with the SOCK_STREAM flag, then the TCP will be used and you will not lose any data since TCP is a reliable transport. However, if you want a potential speed-up in send times (at the risk of losing data), create the socket with the SOCK_DGRAM flag to create a UDP connection.
The Send function takes data in the form of a void* (see above link for further reference).
--Dean
|
|
|
|
|
I have a program that has a list view on a dialog. I have a separate thread from a DLL go out and get some data (from Outlook Express in this case). The data ends up begin returned OK, but wehen I try to add the data to the list control, the data keeps getting put in the first entry. I am using InsertItem(-1, NULL) to insert the data into the list control. The funny thing is that this is working in other modes, just not this one. Anyone have any ideas?
By the way, the app consists of a main EXE, which calls an MFC DLL (which holds the UI). The UI DLL in turn uses an extension DLL to save and load data. The UI DLL also calls an MFC DLL to handle the import of the data (no UI).
Any help would be greatly apprecaited.
[EDIT]
By the way, this only happens on onc test system with Windows 98. Other WIndows 98 systems seem to work fine.
[/EDIT]
Regards,
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
Yeah, I remember that problem. It seems to be special Win98 index behaviour. I circumvented it by simply using:
int x = 0;
while(<cond>)
{
InsertItem(x, "");
x++;
}
BTW I'm not sure it's safe to use NULL as text either
Nick
|
|
|
|
|
Is there any way to force the title of a MDI app to display what you want.. Example lets say I want my MDI title to all ways read "Rob".
When I open new documents or switch between docs I dont want the title to say "My App - [Rob]" I only want to see Rob.
I kind of remember seeing a flag you can set in PreCreateClient that disables this auto-naming feature. But I cant figure it out for the life of me..
Any Ideas?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Just incase anyone else forgets the darn flag its FWS_ADDTOTITLE
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Here's the deal, I have a test class that I am working on and everything seems to be in order, yet I am struck with a link error for every time I use this class (I am using this class from my main() function in main.cpp).
-I have added both the header and source file for the class into my VC++.NET 2003 project.
-Within my main.cpp, is my main() function. At the top of this file, I have the header file to my class included.
-I have my class header file included at the top of the class's implementation/source file.
-The strange thing is when I ALSO include the implementation (.cpp) file at the top of the main.cpp file, it compiles and links with no problems, but I shouldn't have to be including both files.
What am I doing wrong? Or has my VC++.NET 2003 just gone crazy?
Any points into the right direction would be greatly appreciated.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
It's tough to figure out this problem without details about your header/implementation and what the link error is.
Is your class a template? If so, then the implementation must be defined in the header.
- Mike
|
|
|
|
|
Michael Imamura wrote:
Is your class a template?
Yes it is.
Thanks for the info about template class inclusions. I will simply add the implementation code to the header file then. Once again, thanks.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
Hi,
I have a weird linking error happening in my C++ DLL project. In VS.Net 2003, when I compile my dll in release mode, I get the normal "linking... Creating library c:\some_path\blah.lib", but if I do the same in debug, I get "linking..." but the .lib doesn't get created/updated. Other than that, it seems to compile file. No errors get generated.
I've checked the settings between both modes, and I can't see anything different between them.
If I do a "rebuild all" it does update the .lib, but not if I just modify a file and compile the project. I don't want to "rebuild all" everytime I want to test a change. Any ideas?
Thanks!
DJCC
|
|
|
|
|
I've noticed the same thing too. This is just a guess, but I think it's probably fine if the .lib file isn't updated. Basically the .lib file provides the interface for the DLL that you will link against in some other program. So, if you just update the implementation (rather than the function signatures) there is no reason to update the lib file, because the interface to the DLL remains the same.
Again, I'm not 100% sure about that so someone correct me if I'm wrong, but I think you'll be fine linking against the .lib file even if it's not updated.
--Dean
|
|
|
|
|
The real problem I have with this is that when I start changing classes around (adding/removing methods), whenever I stop to and continue from a breakpoint, I get "runtime check failure #0" errors. If I rebuild, which updates the .lib file, I don't get these errors.
DJCC
|
|
|
|
|
See the project settings that you have the 'Import Library' option set under 'Linker->Advanced'. This controls the creation of the .lib file.
Also, you must have a module definition file in your project. If this file doesn't exist, then the compiler/linker creates the export library only if you have dllexport-declarations inside the code files. This might result in incorrect behaviour if those functions which you add to the classes are not exported. The module definition file is not required to export any symbols. All that needs to be there is a line 'LIBRARY your_dll_name_here'.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I create a CF_HDROP data-block representing the file-names of the files i'm dragging.
Everything works great except for dragging into the Recycle-Bin.
I'v read that I need to modify the SetData implementation of my IDataObject so that it accepts the CFSTR_TARGETCLSID format.
Apparently the recycle-bin performs a SetData on me (my IDataObject ) telling me that i'm dropping things into the recycle.
The thing is, I'm not sure what to do with this information...
The data is cached into my data-object but nothing happens.
Funny thing is that if I debug the code and take a several second pause when I get this SetData code, the files do get thrown into the recycle-bin
so, can someone advise ?
p.s - regardless of thigs, dropping into the recycle-bin leaves me addref'd for some reason (m_dwRef in MFC )... which forces me to check it and perform an ExternalDisconnect when this happens, doesn't sound like the right thing to do...
|
|
|
|
|
Hi
i m building voice conversation application .
now i want to send SoundBuffer (of Directx) via Socket to my server.
how can i send it .. will it be lose its data .
plz help mee
thanx
|
|
|
|
|
One solution is winsock. For data reliability, I recommend TCP.
Kuphryn
|
|
|
|
|
Hi!
I'm using ShellExecute to open a link in the browser. If there is a browser instance already running then it will show the link! How can I force the link to be showned in a new instance??
Thank you
Artur Jales Moreira
|
|
|
|
|
Post the code you pass into ShellExecute(). One possible solution is CreateProcess().
Kuphryn
|
|
|
|
|
Try adding -new after iexplore.exe in the ShellExecute parameters. There is a list of command line options here[^].
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
|
Isn't there a method that's compatible with all browsers ? something more 'Windows Specific' rather than IE specific ?
And how does the CLink class help ?
|
|
|
|
|
I've noticed in VS.NET 2003 when you use the app-wizard to generate a new C++ class, the header of the new class begins with #pragma once rather than and #ifndef, #define pair.
Anyone know if there is a way to make it go back to using the #ifndef instead? #pragma once is fine for VS.NET, but when I want to port code to Linux, GCC always complains that it is obsolete.
|
|
|
|
|
To my knowledge, there is no way to make the wizards in VC++.NET 2003 use the #ifndef, #define, #endif inclusion guards instead of #pragma once which is pain. I have had issues with this myself when porting code to Linux. If someone out there knows of a way to do it, I wouldn't mind knowing how to do that myself.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
Alright, I have searched too much, and I don't seem to find the answer.
I create a profile and create a MsgService for it. how can I specify the location of the .pst file?
Thanks in advanced...
|
|
|
|
|
very quick question..
I have following code
<br />
unsigned char buf[1024];<br />
ifstream afile("c:\k.txt",ios::in);<br />
if(afile.good())<br />
stream.read(buf, 1024);
<br />
but I got the following error
error C2664: 'read' : cannot convert parameter 1 from 'unsigned char [1024]' to 'char *'<br />
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
somehow I got no error while passing unsigned char buf[1024] to my function
void myFunction(unsigned char* buf);
why i got error passing the same function eventhough there are 3 istream functions to use
<br />
istream::read<br />
istream& read( char* pch, int nCount );<br />
<br />
istream& read( unsigned char* puch, int nCount );<br />
<br />
istream& read( signed char* psch, int nCount );<br />
thanks
|
|
|
|