|
can u please explain where should i override the OnIdle()?
i overrode it in the MainFrm.cpp and tried to Debug but the Debugger did not went to it.
|
|
|
|
|
That must be done in your CWinApp derived class.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
it did not work it needs CWnd object.
|
|
|
|
|
Create a custom message handler in CMainFrame class.
From CWinApp::OnIdle do a post message like AfxGetMainWnd()->PostMessage
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Could anyone explain for me what these code doing? Could give me an example ? thanks
typedef union ieee_754_single_precision
{
BYTE bytes[FLOAT_BYTES];
float value;
IEEE_SBITS bits;
} SIEEE_754;
void cHARTTransmitter::Float2IEEE(float fDecimalNum, BYTE *pbIEEE)
{
SIEEE_754 local;
short j = FLOAT_BYTES - 1;
local.value = fDecimalNum;
for (i = 0 ; i < FLOAT_BYTES; i++)
{
pbIEEE[i] = local.bytes[j--];
}
}
Float2IEEE((float)m_data, Data);
|
|
|
|
|
It's converting a float from little-endian form (presuming this code is running on an x86/x64 PC) to big-endian. Let me add comments to your code:
typedef union ieee_754_single_precision
{
BYTE bytes[FLOAT_BYTES];
float value;
IEEE_SBITS bits;
} SIEEE_754;
void cHARTTransmitter::Float2IEEE(float fDecimalNum, BYTE *pbIEEE)
{
SIEEE_754 local;
short j = FLOAT_BYTES - 1;
local.value = fDecimalNum;
for (i = 0 ; i < FLOAT_BYTES; i++)
{
pbIEEE[i] = local.bytes[j--];
}
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi ,
I am creating a dialog which is resizable , i have set the property of Border to 'Resizable' which make my dialog resizable . But i am not able to show a 'Resizable Image' on the bottom right corner of the window.
Generally we see these images when we open Internet Explorer in the bottom right corner.
Please provide some comments
|
|
|
|
|
The way I've done it in the past is to create a window of class "SCROLLBAR", with style WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | SBS_SIZEBOX | SBS_SIZEGRIP | SBS_SIZEBOXBOTTOMRIGHTALIGN. You then need to override the parent window's OnSize handler to ensure this window is always at the bottom-right of the parent window.
The other wrinkle is that you probably want to override the parent window's OnNcHitTest handler, so that when the mouse is over this window, you can return HTBOTTOMRIGHT to tell the system that it's over the bottom-right corner part of the border (and so the system will display a resizing cursor).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
You can use of WM_SIZE for set new location of images.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
How can I set the drop down size of a Combo Box. ie., When user clicks on the drop down of the Combo box, I need to set the drop down of the combo box so that it can show only 10 items at a time even though there are more than 10 items.
Thanks,
|
|
|
|
|
|
I am able to get Adobe Acrobat working inside a java JInternalFrame.
However, most of our users don't have a license nor need for Acrobat.
I am trying to get the Adobe Reader ActiveX control to work in java.
I created the "MFC from ActiveX" using the "Adobe PDF Reader <1.0>" control and it is called CAcroAXDocShim by default.
So I create:
CAcroAXDocShim *shim = new CAcroAXDocShim();
I have tried this:
Embed ActiveX controls inside Java GUI[^]
However, hwndChild is always returned as NULL.
It seems like the real problem is the java window which was returned by the JAWT_Win32DrawingSurfaceInfo does not have the ActiveX/OLE controls initialized.
So I tried this:
shim->SubclassWindow( dsi_win->hwnd )
That still fails.
I have also tried this:
Adobe ActiveX Control with MFC[^]
However, I have to render the ActiveX control within an existing java awt component (i.e. an existing HWND). It unfortunately can't create a new Frame.
Is there any way to initialize the HWND returned by the native java awt libraries with ActiveX/OLE support?
Or... better yet... anyone know how to get an ActiveX control like Adobe Reader to display in java?
(perhaps I'm overlooking something; any guidance/comments would be appriciated.)
modified on Wednesday, May 20, 2009 4:00 PM
|
|
|
|
|
|
I think we looked at this before.
1) it isn't maintained by adobe.
2) it hasn't been updated since 1999
3) does it support flash within the pdf?... I'm checking on this now.
4) we'd like for the users to be able to update their Adobe Reader and have the new features available to them.
I'm going to try it and see if it meets or needs or not.
|
|
|
|
|
|
I haven't seen the SWT article.
I will give that a try.
|
|
|
|
|
No, the app is a large swing app and it doesn't look like it's possible to mix SWT and Swing/AWT.
I am currently retrying Embed ActiveX controls inside Java GUI[^]
I had to change
HWND hwndChild = ::CreateWindow(...)
to
CAxWindow* caxw = new CAxWindow( pThreadParam->hwnd );
HWND hwndChild = caxw->Create( pThreadParam->hwnd );
.
However the call to Create(...) fails.
In the debugger it is failing in atlwin.h at ATLASSUME(m_hWnd == NULL); .
The message says "Debug Assertion Failed!"..."Expression: m_hWnd == 0".
But... the pThreadParam->hwnd that is passed in is not null according to the debugger and the printf output.
Any ideas?
|
|
|
|
|
This looks promising (using the javacom example):
CAxWindow* caxw = new CAxWindow( pThreadParam->hwnd );
HRESULT rslt = caxw->CreateControl( L"c:\\test.pdf" );
... and commenting out the rest of the code.
But, it appears to be taking up all of the window area such that I can't resize nor minimize it.
|
|
|
|
|
It's opening in a separate window for some reason.
I can't get it to open inside the parent window.
Any ideas?
|
|
|
|
|
#3 -> no, it doesn't support flash, so I wouldn't expect it to keep up with future pdf standards.
I tested using "viewing the Adobe Acrobat 7.0 interactive tour"[^] from Adobe's website (referenced in Adobe - Reader : New Features[^].
The pdf looks similar to what Reader and Acrobat display, but the "new features" are not available and I get an "UnknownFilterException" when I attempt to resize.
If I scroll to the bottom I get an "unsupported command" error.
We would much rather get whatever version of Adobe Reader they have installed and have it displayed in the window instead.
So... does anyone know how I can use the HWND from the awt jni to display Adobe Reader?
It appears that the missing piece so far is getting the ActiveX/OLE initialized in the parent window (the HWND of the java awt component we're trying to get Reader to draw in).
|
|
|
|
|
I can't find the bug in this small code fragment.
I copied it straight from the book. It's probably 1 error causing a bunch of error message.
#include "stdafx.h"
#include <iostream>
#include <string>
#include "stdafx.h"
using namespace std;
const int MAX = 3;
struct Person{
string name;
int height;
};
int _tmain(int argc, _TCHAR* argv[])
{
Person p[MAX];
for (int x = 0; x < MAX; x++)
{
cout << "Enter person's name: ";
getline(cin, p[x].name);
cout << "Enter height in inches: ";
cin >> p[x].height;
cin.ignore();
}
cout << "Outputting person data\n";
cout << "======================\n";
for (x = 0; x < MAX; x++)
cout << "Person #" << x + 1 << "'s name is "
<< p[x].name << " and height is ";
<< p[x].height << endl;
return 0;
}
|
|
|
|
|
- Please quote your code properly - firstly, select the "Encode HTML tags when pasting" option below the text box and paste your code in, and secondly, please enclose it in <PRE> tags, to display it in a monospaced font.
- Try telling us at least some of the error messages
Also - that second #include "stdafx.h" looks wrong. If you're using precompiled headers, the second stdafx.h will cause the compiler and pre-processor to ignore all the #include statements that occur before the #include "stdafx.h"
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
modified on Wednesday, May 20, 2009 11:12 AM
|
|
|
|
|
there's a ";" that should not be there at the end of this line :
<< p[x].name << " and height is ";
This signature was proudly tested on animals.
|
|
|
|
|
jonathan warfield wrote: It's probably 1 error causing a bunch of error message.
Such as?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
jonathan warfield wrote: for (x = 0; x < MAX; x++)
for visual C++ 2003 onwards, variables defined inside for loopswill not be available outside. either you've to make int x declaration just before the for loop or for teh second for loop define as
for (int x = 0; x < MAX; x++)
jonathan warfield wrote: << p[x].name << " and height is ";
<< p[x].height << endl;
Please remove the unnecessary semi column at the end of first statement.
Anywayz start reading your favorite C++ Book
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|