|
on WM_DESTROY of your modeless dialog set the focus to the desktop window...
Hope this helps you,
Greetz,
Davy
|
|
|
|
|
My application is a SDI and i am invoking the modeless dialog from the menu item click. Once i close the dialog the SDI should get enaled. Which function i have to use set the focus for desktop window. . .weather i have to set focus for SDI or desktop?
Thanx
|
|
|
|
|
uueeMy application is a SDI and i am invoking the modeless dialog from the menu item click. Once i close the dialog the SDI should get enaled. Which function i have to use set the focus for desktop window. . .weather i have to set focus for SDI or desktop?
Thanx
|
|
|
|
|
I think this should set the focus to the main window of your app...
::SetFocus(AfxGetMainWnd()->m_hWnd);
Greetz,
Davy
|
|
|
|
|
sorry Davy. . .Its not working.
I tried it by placing the ::SetFocus(AfxGetMainWnd()->m_hWnd)func in the OnDestroy()func of child.But its not working. Do u have any other idea.
Thanx
|
|
|
|
|
Hi,
Try using SetWindowPos. Have a look @ msdn. i think it is having some same source related to it
Sujan
|
|
|
|
|
Hi
sorryI am not replying your message. ButI wantto knowhow I can also make my name go scrolling as ur "BARIN" does here ....Could u tell me ?
Dharani Babu S
|
|
|
|
|
Actually I tried to make new window which is applied setWindowRegion.
the region was got from BeginPath TextOut EndPath CRgn::RegionFromPath
then make window itself fade out on timer event..
Does that make sense?
But the region which has text area is not neat..
So, I want to listen your opinion..
How can I make text fade out on screen..
the text should have transparent background..
Does anyone have idea?
|
|
|
|
|
Draw text into a transparent window - the background will show through the window and you can see your text.
Change the alpha or gamma of the transparent window over time?
Thus causing your text to disappear?
|
|
|
|
|
if drawing text onto the transparent window,
I wont be able to see the text...
right?
|
|
|
|
|
As I understand it, a transparent window means that the BACKGROUND shows through.
If you don't erase the background of your window and fill it in with anything, what is beneath it will show through. Anything you DRAW in your 'transparent' window will still be on top of whatever is showing though.
So, if you only draw your text when you get the WM_PAINT for your transparent window, the text should show up fine.
|
|
|
|
|
Sorry, I'm still confusing...
You say transparent window,, does that mean layered window?
What I tried was drawing some text on the layered window..
But the text was diaspearing as the window's getting transparent..
|
|
|
|
|
But what I'd like to do is draw 100% opaque string onto the 100% transparent
window..
Thanks anyway, Blake
|
|
|
|
|
Hi
I have a short question about debugging in C++. Let's say I have a member variable that rarely changes, and in my program I suspect there's an invalid modification made to this variable that causes my program to crash. Is there a way to set up a debugger in such a way that it will trap when the variable is changed?
Simple text find in the source files won't do, since more complex circumstances (e.g. int tmp[100]; memcpy(tmp, some_buffer, 101*sizeof(int) /*oooops*/); ) MAY also change the value of the variable if it's located right after tmp[99], and these kinds of error won't be detected by source files text find.
Thanks!
|
|
|
|
|
Hello Indrawati,
You've touched on one of my favourite debugging techniques. I assume that you are using Visual C++ 6.0.
Do the following :
1. Put a breakpoint at the place where your member variable is first created, A good place would be when your object is instantiated.
2. Start to debug your app.
3. After your object has been created and initialized, select and highlight your member variable.
4. Press SHIFT+F9 to bring up the Quick Watch window.
5. You will see your member variable displayed on the edit box labelled "Expression".
6. Put a '&'symbol just infront of your member variable. The memory address of your member variable will appear on the value column.
7. Remember this memory address.
8. Now press CTRL-B to bring up the "Breakpoints" dialog box.
9. Select the "Data" tab in the "Breakpoints" dialog box.
10. In the edit box labelled "Ënter the expression to be evaluated", type in the memory address of your member variable.
11. In the "Enter the number of elements to watch in an array or structure" edit box, type in the number of bytes that your member variable would take up.
12. Click "OK".
You now have a memory address breakpoint. Whenever the contents of this memory address changes (up the the number of bytes you specified in point 11), a message box will appear rto indicate to you that changes have occurred.
Hope this advise will help you.
Best Regards,
Bio.
|
|
|
|
|
Cool Bio ...
Have been searching for this till now ...
Dharani Babu S
|
|
|
|
|
Hi all,
Sorry if my post is at wrong forum.
I have an ActiveX Control with a property name "Title". The put function is like this:
STDMETHODIMP CAxTestCtrl::put_Title(BSTR newVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
m_strTitle = (CString)newVal; // CString m_strTitle
return S_OK;
}
In the web page, which has Shift_JIS charset, I use javascript to pass a Japanese string to the "Title" property:
function doSetTitle() {
AxTestCtrl.Title = Form1.txtTitle.value;
}
After calling the above javascript function, in the ActiveX control, the value of the m_strTitle is "????" (the Japanese string has 4 Japanese characters).
Did my code wrong somewhere?
Any help would be appreciated.
|
|
|
|
|
I just buy a P310C Model. This model has encoder inside. I have been
order to build a encoder application to encode 500 units smart card. I
need help on build the application because I am beginner in C++/MFC. I have been supply with cst25110.h and cst25110.dll
The application story:
The Application will read a text file to encode all cards. The txt file
name CADID_listing.txt contains:
CAD_PIN=22222
CARD_TYPE=01000000
CAD_ID
1234567800
4587452600
5412288400
...
Explaination: CARD_ID will be write to the card, and each card has
CAD_PIN and CARD TYPE written inside. Let say the first card is encode,
so the card will be CARD_PIN=22222, CARD_TYPE=01000000 and
CARD_ID=1234567800 and the second card will be CARD_PIN=22222,
CARD_TYPE=01000000 and CARD_ID=4587452600....and so on until the card is
finished encode.
I have do some research and i only can completed until here,
#include <cst25110.h>
// P310C Smart Card Encoder
ctOpen();
ctEngageCard(); // engage contact station
ctColdReset(); // for SLE 4428 cards.
// actual encoding tasks here!
ctDeactivate(); // power down smartcard
ctDisengageCard(); // disengage contact station
ctClose();
I need urgent help
|
|
|
|
|
-->here my latest code but still has a lot of error
// P310C Encoder
#include "cst25110.h"
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
SCR_SCR_PARAMS myParams; // each instance represents one encoder
void main(void)
{
.
.
myParams.scrAttr.Port = 1; // e.g., target encoder attached to com 1
ctOpen(&myParams.scrAttr);
.
subfunction();
.
.
ctClose(&myParams.scrAttr);
}
void subfunction()
{
.
iccApduExchange(&myParams); // note we did not declare in this function
}
// P310C Smart Card Encoder
ctOpen();
ctEngageCard(); // engage contact station
ctColdReset(); // for SLE 4428 cards.
int main () {
char buffer[256];
ifstream examplefile ("CADID_listing.txt"); // The CAD_PIN, CARD_TYPE, CAD_ID will not be encoded to the card
if (! examplefile.is_open()) // For example each card will be encoded by 55555 00000001 0410000001 ( CAD_PIN, CARD TYPE and CAD_ID )
{ cout << "Error opening file"; exit (1); }
while (! examplefile.eof() )
{
examplefile.getline (buffer,100);
cout << buffer << endl;
}
return 0;
}
ctDeactivate(); // power down smartcard
ctDisengageCard(); // disengage contact station
ctClose();
-> And this is cst25110.h
/*
CST25110.h - Header file for CST25110.DLL API Development
Copyright 2003 Innolab Pte Ltd
*/
// 1. TYPE DEFINITIONS
typedef struct
{
HANDLE hComm; // Transparent handle, leave it alone!
DWORD Port; // Serial Target
DWORD Target; // indicate slot when necessary esp. APDU exchange
} SCR_SCR_ATTR;
typedef struct {
BYTE Protocol;
BYTE Convention;
BYTE pATRmode;
BYTE F;
BYTE D;
BYTE N;
BYTE IFSC;
BYTE IFSD;
BYTE CWT;
BYTE BWT;
BYTE ProgVoltage;
BYTE ProgCurrent;
BYTE ClockStop;
BYTE Class;
} SCR_ICC_PARAMS;
typedef struct
{
BYTE RequestBuffer[256];
DWORD RequestLength; // no of bytes in request buffer
BYTE ReplyBuffer[256];
DWORD ReplyLength; // no of bytes in reply buffer
SCR_ICC_PARAMS iccParams;
SCR_SCR_ATTR ScrAttr;
} SCR_SCR_PARAMS;
typedef struct {
BYTE mfKey[6];
} MF_KEY_DATA;
|
|
|
|
|
I am creating a COM component in VC++ using MFC and automation. The automation process is via the CCmdTarget class and IDispatch. The component is a wrapper for accessing a proprietary binary file which holds information pertaining to a scanning system we use. Specifically each binary file will hold information relating to a particular form setup, such as how many sheets the form has the fields which we are capturing off the form and so on (the package is called IST). A portion of the object model for the file structure is as follows:
Application (only one)
----Records (contains all the fields)
--------Fields
----Documents
--------Sheets
------------Grids (maybe OMR or OCR region on the form, and will link back to one a field)
etc..
The structure is stored on disk in the above manner, and read into structs. The way I have gone about exposing the structs is via nested objects and collections of objects (CTypedPtrArray). So as an example I have exposed the records as IRecord and IRecords, IRecords is a collection of IRecord objects. The annoying aspect of this is that each IRecord object must hold a pointer to the record structure that has been read off disk. This pointer is setup during construction of the collections after it has been read off disk, and will allow us to write back the information to disk if any changes are made.
This is all working fine (from what I can tell) however there appears to be a memory issue when the objects go into final release. It gives access violation error just before the application closes or the control passes the destructor and when using the component from VB it is giving an access violation.
So I’m just wondering whether anyone has any advice with relation to automation, and how to appropriately dispose of objects, as I’m a little confused about the difference between FinalRelease and the destructor. I am happy to send the project if required.
Thanks in advance.
|
|
|
|
|
i think we'd need to see code to make more a a judgement about what may or not be going on
cheers
Bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
Thanks for the response!
How do you want me to send the code, do you wish to have a look at a snip of the code or the complete code? In case yu wish to see the whole code how can I send you the whole project?
Waiting for your kind reply.
Thanks!
|
|
|
|
|
I have been searching for a sample C++ code to show me how to read a file (attributes)version. (e.g right-click on file, version)
any help is greatly appreciated
|
|
|
|
|
|
Hi
I build a dialog-based program in vc++ 6, and add some code,it seems ok.
But when I add MS web browser control to my dialog(click "add activex controls->Microsoft web browser").Dramtically,My app even can not start up---but build is successed.What reason?
Another situation, I put a dialog in dll,and export it from my app. When the dialog not include any activx Control,it works fine,however,if add any activex control ,then you call it in you app( by pMyDlg->DoModal()),the dialog will not work(No error msg,but dialog never appear).
So how can I host a activeX in my dialog in dll and export it in my app?
Any comment will be appreciate.
|
|
|
|