|
I think u will have to use hooks.
Try this link http://www.codeproject.com/dll/hooks.asp
|
|
|
|
|
thx maybe this would help.....just wait me to code some stuff and post reply my result
thx again
Always willing to participate in coding new projects. C++. Multimedia, graphics and hardware.
|
|
|
|
|
I've engaged in a project with the function of displaying DOC and PPT files.
It means that my program can display DOC and PPT files without displaying the menus and toolbars of the MS Office, how can I get it done.
I searched a lot of documents about the Office Automation,but I found none suitable for me.
Thanks for you help!
|
|
|
|
|
You can view doc and ppt files in a webbrowser. Maybe that could be a solution?
Good luck.
No hurries, no worries.
|
|
|
|
|
Look up Active Documents in Google and checkout the MS Binder application.
There should even be a couple of articles on CodeProject that talk about the subject.
"Live long and prosper." - Spock
|
|
|
|
|
Can somebody help me to modify the following program ??
#include iostream
#include cstdlib
#include ctime
#include conio.h
using namespace std;
#define MAX 15 // MAXIMUM CONTENTS IN QUEUE
class queue
{
private:
int t[MAX];
int added; // Addition End
int deleted; // Deletion End
public:
queue()
{
deleted = -1;
added = -1;
}
void del()
{
int tmp;
if ( deleted == -1 )
{
cout << "Queue is Empty";
}
else
{
for ( int j = 0 ; j <= added ; j++ )
{
if( ( j + 1 ) <= added )
{
tmp = t[j + 1];
t[j] = tmp;
}
else
{
added--;
if ( added == -1 )
{
deleted = -1;
}
else
{
deleted = 0;
}
}
}
}
}
void add( int item )
{
if( deleted == -1 && added == -1 )
{
deleted++;
added++;
}
else
{
added++;
if( added == MAX )
{
cout << "Queue is Full\n";
added--;
return;
}
}
t[added] = item;
}
void display()
{
if ( deleted != -1 )
{
for ( int i = 0 ; i <= added ; i++ )
cout << t[i] << " ";
}
else
cout << "EMPTY";
}
};
void main()
{
queue a;
int data[10] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 };
int n , passCode;
do
{
srand(time(0));
n = rand();
passCode = n % ( ( data[9] - data[0] + 1 ) + data[0] );
cout << "Queue : ";
a.add( data[passCode] );
a.display();
cout << endl;
cout << "At Counter : ";
a.display();
cout << endl;
cout << "Transaction Time Left : " << endl;
cout << "Press ENTER to simulate 1 minute." << endl << endl;
}
while ( cin.get() );
}
|
|
|
|
|
|
Actually my question is following ::
a customer enter a bank and have to queue every 2 minute, a random number generator generate a random number between 1 .... 10, each customer is associated with a random number which indicates the time needed for all his/her transaction to be completed.
use an array to implement the queue .
thanks for your help!!
|
|
|
|
|
khyap wrote:
Actually my question is following ::
I don't see any questions in your post !
In fact you are asking to do your homework for you isn't it ?
If you want any chance to have response to your questions, start it by yourself and post SPECIFIC questions when you get stuck. Don't ask us to do everything for you.
|
|
|
|
|
My question is below , but i don't know whether my solution is correct or not ??
a customer enter a bank and have to queue every 2 minute, a random number generator generate a random number between 1 .... 10, each customer is associated with a random number which indicates the time needed for all his/her transaction to be completed.
use an array to implement the queue .
#include iostream
#include cstdlib
#include ctime
#include conio.h
using namespace std;
#define MAX 15 // MAXIMUM CONTENTS IN QUEUE
class queue
{
private:
int t[MAX];
int added; // Addition End
int deleted; // Deletion End
public:
queue()
{
deleted = -1;
added = -1;
}
void del()
{
int tmp;
if ( deleted == -1 )
{
cout << "Queue is Empty";
}
else
{
for ( int j = 0 ; j <= added ; j++ )
{
if( ( j + 1 ) <= added )
{
tmp = t[j + 1];
t[j] = tmp;
}
else
{
added--;
if ( added == -1 )
{
deleted = -1;
}
else
{
deleted = 0;
}
}
}
}
}
void add( int item )
{
if( deleted == -1 && added == -1 )
{
deleted++;
added++;
}
else
{
added++;
if( added == MAX )
{
cout << "Queue is Full\n";
added--;
return;
}
}
t[added] = item;
}
void display()
{
if ( deleted != -1 )
{
for ( int i = 0 ; i <= added ; i++ )
cout << t[i] << " ";
}
else
cout << "EMPTY";
}
};
void main()
{
queue a;
int data[10] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 };
int n , passCode;
do
{
srand(time(0));
n = rand();
passCode = n % ( ( data[9] - data[0] + 1 ) + data[0] );
cout << "Queue : ";
a.add( data[passCode] );
a.display();
cout << endl;
cout << "At Counter : ";
a.display();
cout << endl;
cout << "Transaction Time Left : " << endl;
cout << "Press ENTER to simulate 1 minute." << endl << endl;
}
while ( cin.get() );
}
|
|
|
|
|
I don't know whether my solution is correct or not ??
Why just don't you compile and run your program step by step in debug mode to verify yourselves that everything is correct. This is a simple exercise and you will learn more by trying to debug it yourselves.
However, if you have a specific question about syntax/bug/error/function/etc. in your program, then you can ask here...
Good luck!
|
|
|
|
|
because i do not know whether it meet the question requirement or not ??
how to add only one queue in the "At Counter : " ??
|
|
|
|
|
I need some help in codding ActiveX container. Short description : Microsoft Visual Studio 2003 and other vsersion (6,7) , includes sample TstCon - a sample of ActiveX Container. When I place control and than delete it or open new document, this program hang up every time when i close it.
I modified ContainerItem method OnDelete()... after pItem->Delete() i put delete(pItem); its all works under win2k... but... in 98SE,XP after deleting control, when i try to insert new control an error occured "Failed to connect.Link may be broken".
So does any one knows how to solve this, and force it to work correctly.
Thanks.
|
|
|
|
|
Earlier in Visual Studio 6.0 I used the class-wizard to import a type library. How do I do that in VS 2002?
_____________________________
...and justice for all
APe
|
|
|
|
|
ı want to write these subject of code with linked list but ı can't. Please help me.And ı want you to send a code(if you find) my e-mail address which is nuhcoskun@gmail.com
neeeeeed
|
|
|
|
|
|
can anyone plz let me know how to make a windows explorer like aplication with tree view in the left view and list view in the right wiew
arnab podder
|
|
|
|
|
|
Device information as obtained from Jungo's WinDriver.
----------------------------------------------------------------------------------
1. Config. 1: interface no. 0 , alternate setting : 0
endpoints: 0 , class : 0x1 , subclass : 0x1 , protocol : 0x0
Pipe 00 , Control , direction : IN & OUT , packetsize : 8
2. Config. 1: interface no. 1 , alternate setting : 0
endpoints : 0 , class : 0x1 , subclass :0x2 , protocol :0x0
3. Config. 1: interface no. 1 , alternate setting : 1
endpoints : 1 , class : 0x1 , subclass :0x2 , protocol :0x0
1: endpoint address : 0x1,attributes : 0xd
max packet size : 8 (0x8) , Interval : 1
Pipe 01 , Isochronous , direction : OUT , packetsize : 8
4. Config. 1: interface no. 2 , alternate setting : 0
endpoints : 0 , class : 0x1 , subclass :0x2 , protocol :0x0
5. Config. 1: interface no. 2 , alternate setting : 1
endpoints : 1 , class : 0x1 , subclass :0x2 , protocol :0x0
1: endpoint address : 0x82,attributes : 0xd
max packet size : 8 (0x8) , Interval : 1
Pipe 82 , Isochronous , direction : IN , packetsize : 8
6. Config. 1: interface no. 3 , alternate setting : 0
endpoints : 1 , class : 0x3 , subclass :0x1 , protocol :0x1
1: endpoint address : 0x83,attributes : 0x3
max packet size : 8 (0x8) , Interval : 10
Pipe 83 , Interrupt , direction : IN , packetsize : 8
Windows XP Device Manager Detection
--------------------------------------------------------
KeyPad : Usb Human Interface Device
--------------------------------------------------------
hidclass.sys
hidhub.sys
hidparse.sys
hid.dll
Audio : Usb Audio Device
-----------------------------------------
drmk.sys
ks.sys
portcls.sys
stream.sys
USBAUDIO.sys
ksproxy.sys
kuser.dll
wdaud.drv
Usb Composite Device
-----------------------------------------
usbccgp.sys
They all use the Windows standard driver. No other driver are needed.
Requirements :
-------------------------
I have to send some Control Setup packets to a USB composite device on which i have to carry out the following operations.
1. Detect the On-hook / Off-hook status of a telephone.
2. Set a relay on the board On/Off.
3. Set a buzzer on the board On/Off.
Using WinDriver user interface I sent the following 8-byte Control Setup packets.
1. On-hook/Off-hook status:
--------------------------------------------
C.S packet : C0 00 00 00 00 00 01 00 [ C0 - specifies a vendor specific packet ]
[ 00 (second byte) - request type ]
[ 01 - size of the packet to be returned ]
Nt : The controller onboard the device detected the packet and sent a byte representing the status back ]
2. Set a Relay On/Off :
--------------------------------------------
C.S packet : C0 01 00 00 00 00 00 00 [ 01 - Put the Relay Off ]
C.S packet : C0 02 00 00 00 00 00 00 [ 02 - Put the Relay On ]
3. Set a buzzer On/Off :
--------------------------------------------
C.S packet : C0 03 00 00 00 00 00 00 [ 01 - Put the buzzer Off ]
C.S packet : C0 04 00 00 00 00 00 00 [ 02 - Put the buzzer On ]
I wrote a user application to enumerate the device using the SetupdiXxx functions from the Windows DDK. I succesfully got the device path and opened a handle to the device using CreateFile.
Question 1:
-------------------
Can i send vendor specific IOCTL's to the standard driver. I have come accross 2 files : usbioctl.h and usbuser.h in the WINDDK folder. In usbuser.h I have come accross USBUSER_OP_SEND_ONE_PACKET ioctl. Can i use this ioctl to send 8-byte Control Setup packets to the device. Will this work with the usbccgp.sys driver.
Question 2:
-------------------
If the above method does not work then i think that i will have to write a filter driver. Are there any problems with building filter driver for a windows standard driver. Also since i have a time restriction i want to know whether i can modify the filter driver boilerplate code given in windows ddk under .../src/wdm/usb/filter to handle these control packets.
|
|
|
|
|
We ran into problems writing keyboard filter drivers. It turned out you can not be sure which drivers will respond to which IOCTL, so at the very least, make your IOCTL configurable at runtime (read registry or something for your own non-default settings) since the user might install PC AnyWhere or have a Compaq system that uses up IOCTL points for 'standard' drivers.
Otherwise, at least for the keyboard, it was fairly straight forward (according to developer who wrote them - not me ).
|
|
|
|
|
I have a program that intercepts the WM_GETMINMAXINFO message for every window. The problem I am having is, when I am in the message queue, no widget resizing happens. For instance, when a window with scrollbars tries to maximize, the message is intercepted, and the correct new window size is set, but the scroll bars stay where they were before the maximization. I am calling the defwindowproc, and callwindowproc in my filter when needed, so that is not the problem. Note: the windowproc is called for all windows, not just windows attached to my program.
Please help!
Thanks
|
|
|
|
|
How are you intercepting the message? Are you using a CBT hook?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
yeah, i use a cbt hook to detect the minmax operation, then i do a setwindowlong to my function.
|
|
|
|
|
I am not 100% clear on what you are trying to do. Can you post the code of your CBTHook procedure, and then maybe I can better picture of what is going on.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
hey i finally got it figured out. thanks for trying to help.
if you still care, this is what i am doing:
i have a cbthook which installs a wndproc filter on any window which has a minmax event. the windowproc sets the ((MINMAXINFO *)lParam)->ptMaxTrackSize.y to a value that allows me to still see winamp down on the bottom of the screen (in windowshade mode) when the window is maximized.
once the WM_GETMINMAXINFO message has been sent twice (and that was the part I didn't get), my filter resets the windowproc to its original function.
|
|
|
|
|