|
you don't need a /I , just put the path in the "Additional Include Directories" field.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
Thanks. I missed that "PreProcessor" category you specified.
|
|
|
|
|
Hi..
In the VS IDE : choose Tools->Options
then the Directories tab and set all includ and library directories you need..
|
|
|
|
|
|
My system doesn't find any audiocompressors. When I use ICTYPE_VIDEO, all video codex are found, but when I use ICTYPE_AUDIO, no audio codex are found at all.
I'm using the AVIFile API.
ICINFO compressorInfo;
HRESULT hr=TRUE;
int nCount=0;
while(hr)
{
hr=ICInfo(ICTYPE_AUDIO,nCount,&compressorInfo);
if(hr)
nCount++;
}
Why is that?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Maybe there's another proc to enumerate the audio codex?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I found some code in my ebook: etwork programming fro Windows, MS Press.
SOCKET s;
BOOL bBroadcast;
char *sMsg = "This is a test";
SOCKADDR_IN bcast;
s = WSASocket(AF_INET, SOCK_DGRAM, 0, NULL, 0, WSA_FLAG_OVERLAPPED);
bBroadcast = TRUE;
setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *)&bBroadcast, sizeof(BOOL));
bcast.sin_family = AF_INET;
bcast.sin_addr.s_addr = inet_addr(INADDR_BROADCAST);
bcast.sin_port = htons(5150);
sendto(s, sMsg, strlen(sMsg), 0, (SOCKADDR *)&bcast, sizeof(bcast));
Well, this is how to send... but how to receive UDB packets and then get the IP of the sender!?
I think recvfrom(...) is to be used... hm.. how to get the IP!?!?!?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
I too tried the same thing some time back. I did not get help from anywhere. As my project deadline was nearing, I found a 'rude' way.
I appended the IP address of the broadcaster to the broadcast message at the very end!
|
|
|
|
|
You may want to try this, I never tried it with UDP socket but think it
should work. BTW let me know if you try it and if it works!
DWORD ReadSocket(SOCKET s, LPBYTE lpBuffer, DWORD dwMaxSize,
DWORD dwTimeout , SOCKADDR_IN* pAddrIn )
{
fd_set fdRead = { 0 };
TIMEVAL stTime;
TIMEVAL *pstTime = NULL;
if ( INFINITE != dwTimeout ) {
stTime.tv_sec = 0;
stTime.tv_usec = dwTimeout*1000;
pstTime = &stTime;
}
if ( !FD_ISSET( s, &fdRead ) )
FD_SET( s, &fdRead );
DWORD dwBytesRead = 0L;
int res = select( s+1, &fdRead, NULL, NULL, pstTime );
if ( res > 0)
{
res = recvfrom( s, (LPSTR)lpBuffer, dwMaxSize, 0, pAddrIn, sizeof(SOCKADDR_IN));
dwBytesRead = (DWORD)((res > 0)?(res) : (-1));
}
return dwBytesRead;
}
"One good thing about getting older, you don't loose the ages you've been!"
|
|
|
|
|
It's in the documentation for recvfrom. The second last parameter can point to something you can get the senders IP from.
|
|
|
|
|
What are the differences?
If I use VC++ 6.0 as IDE, which one should be better for developing app?
Thanks a lots
DJ
|
|
|
|
|
All Windows applications are WIN32 application.
MFC is a class library built on top of WIN32 to greatly simplify application developement.
WTL is also a class library for WIN32 development.
IMHO, MFC is much better than using WIN32 directly.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
do we need to understand WIN32 for the purpose to use MFC?
How do you think WTL vs MFC?
last but not least, any good website can we learn MFC online?
Thanks again
DJ
|
|
|
|
|
DengJW wrote:
do we need to understand WIN32 for the purpose to use MFC?
Imho, an emphatic "yes!".
DengJW wrote:
any good website can we learn MFC online
This one! If you're looking for a good book, I recommend Jeff Prosise's book on MFC programming. You could probably pick it up pretty cheap (used) at Amazon.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
For example, I always find it difficut to read codes written by others, or I find it tough to describe the codes which are automatically generated by VC++ IDE?
Any idea?
DJ
|
|
|
|
|
It will become pretty easy after you do a couple of apps. The IDE generated code is very similar across apps.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Imho, you're much better off using MFC, which is a thin object oriented wrapper above the Win32 API. MFC provides a pretty good collection of classes, and with AFX (the application framework), greatly speeds up application development.
The app framework contains a lot of well tested code that takes care of most of the routine tasks common to all apps (creating the main window, handling documents and views, wiring toolbar buttons and menus to commands, etc.). Most of this code can be automatically generated using the MFC App Wizard.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
What kind of app?
The differences:
-----------------------------------------------------------------
MFC is a class library and application framework built on top of the Win32 library.
Win32 is ultimately what every windows gui application/component has to work with.
Win32 requires more knowledge to get started than MFC (IMHO).
Win32 can require more lines of code than MFC for visual aspects of your app.
MFC simplifies visual components through the CWnd class and its message mapping support.
MFC does some funky memory related heap management things I don't fully understand but can cause you problems with certain kinds of situations. (Rare)
Win32 provides no utility classes for such things as string and files. MFC provides many of the most common utility classes. (Note STL and other libraries also provide many of these utility classes.)
MFC's biggest strength is in the framework it provides for developing desktop apps. The Document/view architecture, simple message mapping and other visual related code greatly simplifies development for most types of projects.
My suggestions:
-----------------------------------------------------------------
For desktop apps MFC is by far easier and faster-to-release.
For server-side N-Tier components, MFC doesn't offer very much.
For ActiveX visual components MFC helps a little and can be easier especially if you are already familiar with MFC in desktop apps.
For non-visual COM components it depends on what you are doing. 60-70% of the time MFC won't help you.
|
|
|
|
|
How can i show a dialog resoucre on a CView-dialog at runtime?
I would show the child dialog when a button is clicked on the CView-dialog.
I would place static text controls on the child dialog, and write to these from the CView-dialog.
|
|
|
|
|
If there somewhere is a parameter/class item with the name lpTemplate, try setting it to MAKEINTRESOURCE(<dialogname>) where <dialogname> is the name of the dialog you want to use.
|
|
|
|
|
I don't understand what you wrote!
Can you give me a little code example?
|
|
|
|
|
Use CFormView .
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
What do you mean with "Use CFormView"?
Can you please give me a code example.
|
|
|
|
|
Unfortunately, it's hard to explain this with a code example in a reply. But if you don't need document support and just want to create a simple dialog based app, see this tutorial.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello
I want to send messages from MainFrame to its child views (for example CView and CListView).
In MainFrame there are tree views created from splitterwnd like this;
m_wndSplitter2.CreateView(0,0, RUNTIME_CLASS(CUserListView), CSize (0, 0), NULL);
Those are the ones I would like to send messages to. How do I do that?
How do I get all neccesary handles/pointers to that view.
/Yours truly
|
|
|
|