|
How can I detect the state of a network card???????
I have try to use MIB_IFROW structure in PSDK, but don't know why, the only result I can get from this strcture is: unreachable.
WHy?
Any other solution?????
Send me a email if possible....
cheers
m0th@dcs.shef.ac.uk
|
|
|
|
|
Is it possible for more than one window to be "active" in an MDI app? I ask because I need to have a toolbar send commands to all open views, not only the one active view. Possible?
thanks,
Jake
|
|
|
|
|
I don't think you want to do that by trying to make all open views active, even if you could. I assume you are using the Document/View architecture. If it were me, I would utilize your app's CDocument class, via the UpdateAllViews() call, to achieve that result, passing a hint to each view as to what toolbar command was sent. I have also seen people use the Main frame window to communicate commands to each open view - but I prefer CDocument. Just a suggestion.
|
|
|
|
|
Thanks for the help - The UpdateAllViews is exactly what I want to do, except I can't get it to work for some reason. I'm basically doing something like:
The View catches the toolbar message, and a handler function is called. This function does some stuff and ends with: GetDocument()->UpdateAllViews(this, ENUM_VALUE1, NULL). Ideally this should call the OnUpdate() function of every open View, assuming I have an enum that allows ENUM_VALUE1.
However, OnUpdate never gets called. Passing "this" prevents it from being called on the active view, and nothing happens to the inactive views. I can't figure out why it's not doing anything
thanks again,
Jake
|
|
|
|
|
Unless all the views in your application share the same document, this approach will not work. You must first get a list of all the open documents, and then update all their respective views.
It might look something like the following;
CWinApp * pApp = AfxGetApp ();
ASSERT_VALID ( pApp );
POSITION posTemplate = pApp->GetFirstDocTemplatePosition ();
while ( NULL != posTemplate ) {
CDocTemplate * pTemplate = pApp->GetNextDocTemplate ( posTemplate );
ASSERT_VALID ( pTemplate );
ASSERT_KINDOF ( CDocTemplate, pTemplate );
POSITION posDocument = pTemplate->GetFirstDocPosition ();
while ( NULL != posDocument ) {
CDocument * pDocument = pTemplate->GetNextDoc ( posDocument );
ASSERT_VALID ( pDocument );
pDocument->UpdateAllViews ( NULL, ENUM_VALUE1, NULL );
}
}
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Send the messages by way of the associated documents instead.
|
|
|
|
|
I`m don`t think so, but some way to do this is to thru all your view using GetNetView, GetActiveview.
|
|
|
|
|
Is there anyway in Win32 or MFC, to retrieve the current directory of the running application?
Anytime, I run GetCurrentDirectory, I get the default windows directory or my desktop directory depending on the platform.
thanks
|
|
|
|
|
Use _getcwd ()
// GETCWD.C FROM MSDN
#include <direct.h>
#include <stdlib.h>
#include <stdio.h>
void main( void )
{
char buffer[_MAX_PATH];
if( _getcwd( buffer, _MAX_PATH ) == NULL )
perror( "_getcwd error" );
else
printf( "%s\n", buffer );
}
It is Illogical to define an inventor by his invention
|
|
|
|
|
Why Word ignores the message WM_VSCROLL? Is there an alternative to this method for making Word scroll down its contents?
|
|
|
|
|
hi all,
can you please tell me how to include the source code given int his site can be used in my application;)
i would like to experiment
|
|
|
|
|
I'm not sure what you're asking. Copy the class you want to use into your project directory, add it to the project (projectg/add/files from memory), and use it.
Jonathon
|
|
|
|
|
I am having problems using the DirectSound API. The problem is that sometimes my program attaches itself to the soundbuffer and does not release it. This prevents any other device from accesing the buffer.
Does anyone know what I am doing wrong??
Also, is there an easier way to stream audio?? I have DIS packets containing sound data that I need to stream. Is there a way to use the ActiveX Windows multimedia component to stream audio data that is not coming fram a file??
Please help me if you have any ideas....
Daniel Selberg
|
|
|
|
|
Netmeisters,
I am having a great deal of difficulty doing something with VC++ which
should be very simple, and would appreciate your help. All I would
like to do is, create a static library and link an application to it
(as I said, it should be very simple...). The static library contains
C type functions, rather than C++ classes.
I create the library, we'll call it foo, by selecting New Project |
Win32 static library, and leaving the two options (MFC support and
precompiled headers) unchecked. Then I create two files, foo.h and
foo.c, in the library. The first just contains
void bar(void);
and the second
void bar() { }
This compiles OK, creating the file foo.lib. Now if I want to use
bar() in an application, I should just have to include foo.h and
specify a link to foo.lib. I do the latter by using Project | Add to
Project | Files, after which foo.lib shows up in the pane on the left
under Resources. When I compile the application, however, the include
file gets read (because there are no complaints about bar being
undefined), but the linker complains that bar is an unresolved symbol.
I have example code from a book showing how to do this, and the code
compiles just fine. Also, if I add my function bar() to the example
code, everything works as expected. If I declare bar() in my include
file, but define it in the example library, everything works fine. But
for some reason I can't define it in my own library; linking just
doesn't work.
There must be some straightforward way of making all this work, but
for the life of me I can't figure it out. This kind of thing is real
simple under Unix, don't know what is going wrong under Windows. Would
very much appreciate some assistance.
Thanks,
Matthew Fleming
------------------------------------------------------------------------------
Matthew G. Fleming, MD phone : 414.456.4072
Associate Professor fax : 414.456.6518
Department of Dermatology s-mail: Dept. of Dermatology
Medical College of Wisconsin Medical College of Wisconsin
MFRC Room 4061
e-mail: mgf@mcw.edu Milwaukee, WI 53226-4810
------------------------------------------------------------------------------
|
|
|
|
|
Generally speaking, the issue has to do with the "name mangling" a c++ compiler imposes. I beleive if you use:
extern "C" {
Func1();
Func2();
etc }
or
extern "C"
{
#include <my_c_header.h>
}
you should get better results.
MSDN has some info on this if you want more. I have not dealt with this since way back in my 16 bits days, but I think that is what you are probably running into.
|
|
|
|
|
I think you need to add your library in Project|Settings...|Link in category Input in the Object/Library modules field.
|
|
|
|
|
I want to use MS Agent control in my Dialog Base App.... and I don't know... your help is big.. please put it to my project...
Contact me by mail if you want to develop with me!!!!
nikado@pc.nu
/*
BETA
*/
|
|
|
|
|
>>your help is big.. please put it to my project...
I wish my wife would say things like this to me.....
Jonathon
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msagent/hh/msagent/pacontrol_6lyk.asp
The above URL should be a good starting point.
Michael
|
|
|
|
|
How will I put buttons and may be drop-down menus into a tab..... HOW!!!
/*
BETA
*/
|
|
|
|
|
I am again with the question refered before as COleDateTime.
I am using classes derived from CRecordSet to do ODBC connectivity. I want to pass null values to the database. The wizard have created variables for every table field. How do I pass null values to the DB especially DateTime.
This is urgent.. please.
|
|
|
|
|
Call CRecordSet::SetFieldNull. Pass field variable address as first param and TRUE as second.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
I know this is more than likley a dumb question but... I have seen some dialog boxes where right below the menu they have drawn a simple straight line to devide the menu from the dialog box.. how do they draw a straight line?
Thanks,
Rob
|
|
|
|
|
Use a group box with no caption and make the height of the box smallest size.
cheers
Alfadhly
|
|
|
|