|
thanx, Jörgen
i think i found the cause - its actually not the IStream, but the GIF image data inside of it that makes the Image constructor fail. When i exported the GIF image and saved it anew (in acdsee) - the new file is slightly different and Image aquires it without problems.
I'll be digging it some more, but its a different matter now
thanx again
see you around
|
|
|
|
|
Hello,
can please someone explain me, how modeless dialogs are working ?
Does they have their own message queue ?
Which thread is processing their messages ? (When I have one threaded
application which just created couple od modeless dialogs) ?
rrrado
|
|
|
|
|
Message Q's are on a per-thread basis - each modeless dialog your thread creates will be serviced by the same message Q - it's the magic call(s) to IsDialogMessage in the message pump that translates the keyboard messages for each dialog.
|
|
|
|
|
Thanks !
rrrado
|
|
|
|
|
I make an Application running on PocketPC, but I don't know how to get current directory for my App.
Ex: I put my App in \Program files\MyApp\
When I change its location, I can't read my data file in the newfolder!
Ex: I change its location to: \MyApp1\
HonestRing
|
|
|
|
|
GetModuleFileName will give you the path and filename, all you'll need to do is strip the filename from the end and replace it with your data file name.
Have a look on MSDN for more info, as the function may not be supported by all devices.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
I am working on a functionality just opposite to what the Microsoft Depends does. Rather than finding out the dependencies of an exe/dll I need to list down the exe's/dll's dependent upon a particular function in a library.
Is there any such utility available? Or can I get some help on the same?
|
|
|
|
|
Hi everybody,
I would like to know if someone could tell me if a debugger made to find memory leak problem exist for windows environment & if it's ok where i could find it? Some of my friends tell me about a software called "valgrind" which only works under linux environment!
Thanks in advance for yours answers
Gerald
|
|
|
|
|
If your app uses MFC, you can use the DEBUG_NEW macro, and memory leaks will be outputted to your Output windows in Visual Studio. This even tells you the line of code where the object was "new"ed.
At top of all .cpp files:
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
|
|
|
|
|
What is the difference between CSocket and CAsyncSocket
Accrding to MSDN CSocket is a blocking socket and CAsynSocket is a non blocking socket from it what i understood that for example if u make a call on CSocket Recieve it will not return untill u get the whole data (which is wrong when data is on average > 5 k u have to make multiple recieve call to fetch the whole data)
but in case of CAsyncSocket u will have to loop to get whole data .
but another joke written in MSDN is that one should not make multiple recieve calls in OnRecieve while using CSocket::Recieve cauz CSocket is internally dooing looping to recieve whole data.
but with single call u cannot get the whole data atonce. so result of it's is that CSocket becomes useless after transferring 40 , 50 k data on average.
so can anybody explain this scneriao . what is the best way to recieve data in OnRecieve and what socket should i use CSocket or CAsyncSocket.
Note:i am writing a Video streaming software so server on average sends me data range from 5 to 15 k /sec .what i do in OnRecieve is asfollows
do//i am using CSocket
{
res=Receive(ptr,lLength);//where ptr is buffer of size of incoming data
if(res==SOCKET_ERROR)
{
Close();
break;
}
ptr+=res;
total+=res;
}
while(total<lLength);//lLength is size of incoming data
in this case according to msdn i am making multiple recieve call which is wrong , but the reason for it is that i am not able to recieve whold data with one Recive call .
but the result of this code is that it works for hardly 10 to 12 frames. and i have to reconnect again.
No Worries!
|
|
|
|
|
I would try to stay away from CSocket and CAsyncSocket (I have ran into lots of problems with both).. If you use standard WinSock and stay away from those wrapper classes it would be much easier.
Here is a example of how I might do the loop..
char buff[4096];
int nRec;
while(nRec = recv(client,buff,sizeof(buff),0))
{
if((nRec == SOCKET_ERROR) && (nRec != WSAEWOULDBLOCK))
{
}
else
{
}
}
Hope this helps..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
But is it possible to get OnReceive , OnClose like event notifications using WINSOK , can u refer me some good code regarding this.
No Worries!
|
|
|
|
|
Yep you can get all those notifications.. Look around in CodeProject under Internet & Network there are quite a few articles from basic to advanced.. I will dig through my favorites when I get into work and email you some URL's with examples and good reading..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Here is another good WinSock site.. I thought I had more links at work but I don't.. Anyway between Codeproject's Internet & Network area and the following link you shouldn't have many problems converting over to WS..
http://www.sockets.com/
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
thanx for ure reply.Some One has told me that BSD sockets are best of all , what u think abt it.cauz i now that CAsyncSocket is also a wrapper on WINSOCK , if that has problem how can i write a better wrapper than that , specially when u have limited time.
No Worries!
|
|
|
|
|
Strangely enough, I never found any problem with CSocket. [Edit] I was able to send/receive data over 4 mega bytes using CSocket. [/Edit] But I don't have a simple sample program for you.
If you don't mind reusing existing code, maybe you can check out this article[^], which does a lot more than you need.
[Edit] You will have to use it in both of your programs (client and server) [/Edit]
My articles and software tools
|
|
|
|
|
Hi all,
Is it possible to determine how many and what types of hooks are installed?.
Thanks in advance,
Abhishek
|
|
|
|
|
Hello,
I'm currently writing a win32 application and I was wondering how I could make an address bar, like Internet Explorer, for the top of my program? Thanks, Caleb
|
|
|
|
|
You can use a ComboBox for the adressbar and insert the adress with m_myCbo.Addstring() . If you want to show the adresses which are inserted before and you run the programm again write it into the registry or in an *.ini-file with WriteProfileString and GetProfileString() .
Example:
<br />
CString strSection = "My Section";<br />
CString strStringItem = "My String Item";<br />
CString strIntItem = "My Int Item";<br />
<br />
CWinApp* pApp = AfxGetApp();<br />
<br />
pApp->WriteProfileString(strSection, strStringItem, "test");<br />
<br />
CString strValue;<br />
strValue = pApp->GetProfileString(strSection, strStringItem);<br />
ASSERT(strValue == "test");<br />
<br />
pApp->WriteProfileInt(strSection, strIntItem, 1234);<br />
int nValue;<br />
nValue = pApp->GetProfileInt(strSection, strIntItem, 0);<br />
ASSERT(nValue == 1234);<br />
The ini-file got the name of your programm and you can find it under C:\Windows\ or C:\Winnt\.
PR
|
|
|
|
|
1. Create the address bar like dialog window in Resource editor. Set the style CHILD and border NONE.
2. In CMainFrame class declaration add:
CDialogBar m_wndAddressBar;
CReBar m_wndReBar;
3. In CMainFrame::OnCreate() add:
m_wndAddressBar.Create(this, IDD_ADDRESSBAR, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
m_wndReBar.Create(this);
m_wndReBar.AddBar(&m_wndAddressBar);
The IDD_ADDRESSBAR is the resource ID of your address bar in Resource editor.
Robert-Antonio
|
|
|
|
|
|
Hello all
Is there any function to findout the version information of a DLL programatically. Pls help..
Thanks
Hari.
|
|
|
|
|
|
There sure is. The function is defined in <shlwapi.h> which is part of the Platform SDK.
<code>
HRESULT CALLBACK DllGetVersion(DLLVERSIONINFO *pdvi);
</code>
Hope this helps.
|
|
|
|
|
Thank you very much for the replies.
|
|
|
|