|
looks like linux kernel code
Don't try it, just do it!
|
|
|
|
|
Hello!
I want to create an own ActiveX control whitch comprised the functionallity of the ShockwaveFlash Control. If I use the Shockwave Control in a normal *.exe application I have no problem to use the functionallity but if I want to test my own ActiveX in the Testcontainer it doesn´t run...
My problem is I think that I didn´t realy now were and how I have to initialize the Shockwave Control in an ActiveX... The rest of the control runs very well....
Is this kind of ActiveX creation realy possible???
Thank´s for every tip!
Andreas
|
|
|
|
|
hi friends,
I have one process running. I wanted to know it's parent.Is there any function available?
|
|
|
|
|
Hi,
I'm not sure what u mean. but the following may help.
FindWindow() - API.
thanks,
Zxczc
|
|
|
|
|
Hi all
Imconfused by a daft problem..
Our apps are written using MFC (CStrings etc) but we are using a library which uses ATL (strings). I understand string is a basic string but cant get my head around this simple problem...
I cannot assign a string longer than 15 chars...
To show an example..
string s1;
CString cs1;
cs1 = m_sRootURL.Left(10);
s1 = cs1.GetString(); // ok
cs1 = m_sRootURL.Left(12);
s1 = cs1.GetString(); // ok
cs1 = m_sRootURL.Left(14);
s1 = cs1.GetString(); // ok
cs1 = m_sRootURL.Left(16);
s1 = cs1.GetString(); // not ok, s1 = "5rf"
All help etc.. etc...
|
|
|
|
|
|
WTL header file. ?? please tell me more...
|
|
|
|
|
Ok, sorry, found it and investigating...
Ta everso..
mark
|
|
|
|
|
|
mlatimer wrote:
cs1 = m_sRootURL.Left(10);
s1 = cs1.GetString(); // ok
At this point, what is the fourth character in s1 ?
mlatimer wrote:
cs1 = m_sRootURL.Left(16);
s1 = cs1.GetString(); // not ok, s1 = "5rf"
At this point, what is the 14th and 15th characters in m_sRootURL ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
Anyone can help will be greatly appreciated.
My program is having a few list box for the user to type in their details.
I will need to convert to html and use MSword to view the report on what they have keyed in and allow them to print out.
I'm using wsprintf command for each textbox and it did generate a html file. however, the multiline of all text boxes becomes one whole line shown in the html report. From the source of the html file, it becomes a blank space. If I manually add a , the new line will be shown in the html file.
How to solve this problem?
|
|
|
|
|
|
Hello,
I am working with serial communication for interacting with a hardware device i.e ControlPanel. The Control Panel has many buttons on it. I need to track which key is pressed or released and give appropriate messages to the application. On key press, I started a thread to track the key down and repeat states of the key. Then when the next key is down, I am ending the previously started thread and starting a new thread to track the state of this new button. This is working fine for me. But the overhead associated with constantly spawning and ending threads can be quite significant for a real time application.
The reason for using threads is that tracking of key state process should not hinder the user interface.
Can anyone please suggest any alternative to using threads in the above scenario.
Below is my thread function code for your reference:
unsigned WINAPI CControlPanel::KeyMsgThread(void *i_param)
{
CControlPanel *cp = (CControlPanel*)i_param;
//key hit
//
string Key;
Key = cp->m_KeyValue;
int repeat_count = 1;
//Create an event object for that thread
//
cp->m_hStopEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
if(cp->m_hStopEvent)
{
ResetEvent(cp->m_hStopEvent);
}
else
{
CloseHandle(cp->m_hStopEvent);
cp->m_hStopEvent = NULL;
cp->m_IsActive = false;
return 0; //exit the loop
}
//Check for delay time first
//
if(WaitForSingleObject(cp->m_hStopEvent, cp->m_Delay) == WAIT_OBJECT_0)
{
CloseHandle(cp->m_hStopEvent);
cp->m_hStopEvent = NULL;
cp->m_IsActive = false;
return 0; //exit the loop
}
//Stop processing data
//
if(cp->m_bKeyMsgThreadStart == false)
{
CloseHandle(cp->m_hStopEvent);
cp->m_hStopEvent = NULL;
cp->m_IsActive = false;
return 0;
}
//If the key is still pressed down after the delay time,
//post additional key down message to the application thread
//
cp->PostKeyStateMessage(Key,"Repeat",repeat_count);
repeat_count++;
//Check for repate rate after the delay
//
while (cp->m_bKeyMsgThreadStart )
{
//Check for repeat rate
//
if(WaitForSingleObject(cp->m_hStopEvent, cp->m_Repeat) == WAIT_OBJECT_0)
{
CloseHandle(cp->m_hStopEvent);
cp->m_IsActive = false;
cp->m_hStopEvent = NULL;
break; //exit the loop
}
//Stop processing data
//
if(cp->m_bKeyMsgThreadStart == false)
{
CloseHandle(cp->m_hStopEvent);
cp->m_IsActive = false;
cp->m_hStopEvent = NULL;
break;
}
//If the key is still pressed down after the repeat time,
//post additional key down message to the application thread
//
cp->PostKeyStateMessage(Key,"Repeat",repeat_count);
repeat_count++;
}
CloseHandle(cp->m_hStopEvent);
cp->m_IsActive = false;
cp->m_hStopEvent = NULL;
return 0;
}//KeyMsgThread
To start the thread:
//Start thread to track its state(up/down) change
unsigned thread_id;
m_hKeyMsgThread = (HANDLE)_beginthreadex(NULL, 0, CControlPanel::KeyMsgThread, (LPVOID)this, 0, &thread_id);
To end the thread:
/Post Key Up State message to application
PostKeyStateMessage(m_KeyValue,"Up");
//End the thread that keeps track of repeat and delay msgs
if(m_KeyValue.compare(m_LastKeyDown) == 0)
{
SetEvent(m_hStopEvent);
}
Your expert guidance will be of great help to me!
Thanks
Madhavi.
|
|
|
|
|
Ignore other message
I wrote a program in VC++6 to load bitmaps and it works correctly when I place the same code into VC++7 it compiles but crashes when I try to load a picture
The code in question is it bombs on the verify command
if(m_hMyBmp != NULL )
DeleteObject(m_hMyBmp);
m_hMyBmp = (HBITMAP) LoadImage(AfxGetInstanceHandle(), filename, IMAGE_BITMAP ,0,0, LR_LOADFROMFILE);
m_DisPicture.GetClientRect( &rectStaticClient );
rectStaticClient.NormalizeRect();
//rectStaticClient is a constant so Stretchblt wont accept it
MyBoxWidth = rectStaticClient.Width();
MyBoxHeight = rectStaticClient.Height();
// Convert to screen coordinates using static as base, then to DIALOG (instead of static) client coords
// using dialog as base
m_DisPicture.ClientToScreen( &rectStaticClient );
ScreenToClient( &rectStaticClient);
GetObject( m_hMyBmp , sizeof(BITMAP), &m_bmpBitmap );
VERIFY(m_hMyBmp2 = (HBITMAP)SelectObject(dcMem, m_hMyBmp));
I get an assertion error on the last line above
|
|
|
|
|
I want to handle WM_MOUSEMOVE event of the toolbar. how to do it?
i created one class for that as below.
class CAnnotationBar : public CToolBarCtrl
{
// Construction
public:
CAnnotationBar();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAnnotationBar)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CAnnotationBar();
// Generated message map functions
protected:
//{{AFX_MSG(CAnnotationBar)
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
and i created a instance variable for this class in my ActiveX control class.
i Added the following code in OnCreate.
CRect rc(0,0,600,50);
m_AnnotationBar.Create(WS_CHILD|WS_VISIBLE|CBRS_TOP|CCS_TOP ,rc,this,IDR_TOOLBAR);
m_AnnotationBar.MoveWindow(0,0,600,50);
m_AnnotationBar.ShowWindow(SW_SHOW);
|
|
|
|
|
I wrote a program in VC++6 to load bitmaps and it works correctly when I place the same code into VC++7 it compiles but crashes when I try to load a picture
The code in question is
|
|
|
|
|
Is there a share file\folder common dialog?
I have a explorer type app, I would like to right click on a folder or a file in my program and have an option to create a new 'NT Share'. It would be really cool if windows had a common dialog for doing this.
Any Ideas?
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi there,
The below code is a part of an encryption algorithm. It is supposed to be copying the material to a state matrix. 4 by 4 martix.
By problem is.. how does the code work? Does it fill in the array vertically or horizontally?
i e :- suppose the value of the ‘key’ in the below code is 0123456789123456
the result is
horizontal vertical
0 1 2 3 or 0 4 8 3
4 5 6 7 1 5 9 4
8 9 1 2 2 6 1 5
3 4 5 6 3 7 2 6
/****the code is******/
int KC = 16;
int* tk = new int[KC];
for(i=0; i
|
|
|
|
|
You need to check "DO not treat <'s as HTML tags" for us to see your code.
You should also try running it yourself to see how it works. In a debugger, you can see what each line does, and examine memory to see how the resultant array is structured.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
-c wrote:
can anyone explain me tha code plsss??
yes of course I can
-c wrote:
how the shifts work and etc??
MSDN
-c wrote:
Does it fill in the array vertically or horizontally?
you can either use the debugger to do this, or insert a printf() in the for( ;; ) loop to see...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello,
My problem is (I hope) a simple one. I need to be able to display an image in visual c++, and I need to refresh that display 5 times a second. The catch is that the image will be in the format of an 'mwarray'. Any help would be greatly appreciated.
Thank you,
Paul
|
|
|
|
|
What is a mwarray ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I'm not really sure. All I know is that I'm using functions that were created in Matlab to process the images, and they require that the format of the images be of class 'mwArray'. I hope that helps.
Thanks
Paul
|
|
|
|
|
What are you doing this for ? Do you really want to be tied to Matlab ?
An mwArray is a helper class in Matlab. You'll need to look into Matlab for ways to display it, especially if you want to update the display periodically.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I've looked under Matlab's documentation, and this is all I could find about 'mwArray':
"In C++, beginning with MATLAB 5.0, the name of the basic MATLAB data type, mwMatrix, has changed. The new name for the data type is mwArray."
All I got from this documentation is that when Matlab code is converted to C++, all variables are of the class 'mwArray'.
As far as being tied to Matlab goes, we don't really have a choice. We need the Image Analysis Toolbox in order to extract the information we need from our input images.
At this point, we are fairly confident we can obtain an object of class 'mwArray' in which the intensity of each pixel (0->black and 255->white) is in the corresponding point in the array. All we need right now is a way to display these pixels in a MFC Visual C++ file, and how to automatically refresh the image a few times a second. We never realized how difficult it would be.
Thanks
Paul
|
|
|
|