|
Hello,
Just wondering if anyone has any neat tricks to give users an option to have your software startup when windows loads (or not startup)..
Any ideas?
Rob
|
|
|
|
|
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
|
|
|
|
|
We have a rather large touch panel interface design application that was not originally designed for or compiled with the _UNICODE compiler flag. We have need now to be able to accept Unicode character input (either via foreign keyboard/OS, or by IME, or by clipboard) in a single specific edit control (which is currently a CEdit object).
I've done considerable amounts of research and testing into overriding window procs and message pumps in an attempt to receive WM_CHAR messages as Unicode character codes, but have not achieved 100% success (i.e., some characters come though as Unicode, but others still come through as the familiar '?'/0x3F character).
Any insight or tips & tricks to pull this off would be greatly appreciated, as we are willing to try just about anything to avoid having to recompile as a Unicode application and deal with the time and headaches involved with the conversion and with linking with external LIBs and DLLs.
As always, thanks in advance.
Rob Whapham
Managing Software Engineer
AMX, Corp.
http://www.amx.com/
|
|
|
|
|
I want to embed the WebBrowser control in my application, and I want to add custom protocol handling. I figured I just host the protocol handler in my application and register it on app-startup.
However, it looks like the protocol registration is global, and hence any other running instance of IE open while my application is open will use the same handler.
Is there some way to register handlers for a specific instance of the browser? Or do I just get to put up with this "added feature"?
J
May the bear never have cause to eat you.
|
|
|
|
|
Hello everybody
I have a normal combobox in a dialog, and besides the initial items loaded from a file I want the item shown in the editbox area of the combobox to be automatically updated when the user writes something inside it. I also wuld like this string to be "stored", so that next time he/she pulls down the combobox this string is still there.
I actually tried to implement notification handlers for: ON_CBN_SELENDOK , ON_CBN_EDITCHANGE and ON_CBN_EDITUPDATE but I couldn't exactly get what i need.
Any info/tip will be greatly appreciated
thank you
best regards
|
|
|
|
|
You want the program to add new items to the combobox as the user types in text?
For example:
EditBox: January
ComboBox:
J
Ja
Jan
Janu
Janua
Januar
January
Is that what you mean? Window should send ON_CBN_EDITCHANGE as the user makes changes to the editbox. Add new items accordingly.
Kuphryn
|
|
|
|
|
Hello, thank you
with reference to your example i'd wish adding just only 'January', I mean when the user has entered a new complete item
thanks again for any tip
best regards
|
|
|
|
|
One solution is to process the data in real-time. Thus each time the user makes a change, you analyze the text and process it accordingly.
Kuphryn
|
|
|
|
|
Hello,
I am in need of a NON MFC sample project or code fragment that accesses a non-windowed ActiveX control. i.e., a control that doesn't have a GUI aspect to it like MSCOMM. After doing searches here and on MSDN, the only posts I've found suggest not to use the Win32 SDK, but to use MFC. In this instance, that is not an option. However, if there is an article that can be used to convince the customer otherwise and use MFC, that would be better. Right now they want to use the Win32 SDK with one of our ActiveX controls.
Any help would be appreciated.
Regards,
Paul...
|
|
|
|
|
use #import. It only includes <comdef.h> and not other ATL/MFC.
|
|
|
|
|
Thanks for the suggestion, but it doesn't explain much to me.
Here is the call to the Create function of the control:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,<br />
DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,<br />
CCreateContext* pContext = NULL)
What is used for the CWnd* parameter since the parent will get event messages?
Do you have an example of how #import can be used for the call above?
|
|
|
|
|
I am confused "..NON MFC sample ..." "...non-windowed ActiveX..." "...that doesn't have a GUI aspect...".
In the sample above, you are creating window(1) and using MFC(2) for it. It kind of does not match the original requirement .
What I was proposing is following
in stdafx.h (or main.h or whatever.h file you are using)
#import "libid:12345" no_namespace //12345 being libid of your control
in your code.cpp
void somefunction()
{
//Note: IYourControlMainInterfacePtr and
//YourControlsCoClass generated by #import
IYourControlMainInterfacePtr spMain(__uuidof(YourControlsCoClass));
spMain->SomeMethodOnTheControl();
.....
}
|
|
|
|
|
AlexO wrote:
In the sample above, you are creating window(1) and using MFC(2) for it. It kind of does not match the original requirement
Well, I see what you mean but actually I am not using MFC and I am not creating a CWnd based window. The line of code is the create function for the control. One of the parameters is a pointer to a CWnd. The application does have a Window but created using CreateWindow ...so this is where I am stuck. Can't use any temp CWnd object to attach to, but the window is needed to get messages from the control. The non-GUI aspect is that the control does not display a pie chart or something ...it is used to control an I/O device. I think I have a lot of reading to do, but not sure where to look to do this or even if I am going about it the right way.
Thanks for the help.
Regards,
Paul...
|
|
|
|
|
Thanks for the help. I really need to read up on this stuff!
|
|
|
|
|
Control is the word, which probably confused us both. Here is the deal: even if your control has UI, you still (in most cases) can use it as a simple COM object. Since your control does not have UI, it simplifies the problem. In my example I showed how to create a COM object and call in method on it. My guess you do not need window, or at least do not need to attach your control to it.
|
|
|
|
|
|
I'm trying to save CDIalog objects in a vector, and it doesnt like the push_back since no copy constructor is available. How do I get around this?
Appreciate your help,
ns
|
|
|
|
|
save the addresses of the dialogs.
myVector.push_back(&someDialog);
Max.
|
|
|
|
|
Thats what I am going to do now. IT will be fine for my current tests, but I dont know if I'll need the actual object later. If I do I can alwyas deref this pointer right?
Appreciate your help,
ns
|
|
|
|
|
if it's in a vector you need to do something like :
CDialog* pDialog = (*it);
Max.
|
|
|
|
|
Thanks very much! It seems like it will do, except I'm troubled by a null pView pointer so I cant test things out yet ...
I have another thread about it.........
Since I was getting a null pView I resorted to externing for the moment and now I am getting a crash on the
CImageDisplay* imageDisplay =m_imageDisplayVector[0];
imageDisplay->GetWindowPlacement(&wp);
GetWindowPlacement, and thats because the pointer coming out of the vector (I only had one element in it) is null!!!!!
I'm plagued by null pointers today...
Help!
Appreciate your help,
ns
|
|
|
|
|
I want the location and size of my CDialog that was spawned by a CView. In the OnDestroy of the mainframe I will save the location,size etc. I have access to the CDIalog object I created.
SO if I do
imageDisplay.GetWindowRect(&rect);
what will come back in rect?
imageDisplay = *pdlg where pdlg was the modeless dialog pointer used in pdlg->Create()
Is this rect.top, .left etc not in terms of the coordinates of the Computer screen? MSDN says :
Copies the dimensions of the bounding rectangle of the CWnd object to the structure pointed to by lpRect. The dimensions are given in screen coordinates
Someone said to use GetWindowPlacement. Wont the GetWindowRect give me everything I need?
For GetWindowPlacement MSDN says:
rcNormalPosition<br />
<br />
Specifies the window’s coordinates when the window is in the normal (restored) position. <br />
but doesnt tell me what the coordinates origin is...
Appreciate your help,
ns
|
|
|
|
|
GetWindowRect tells the current screen coordinates.
GetWindowPlacement will tell you if the window is minimized, maximized or restored (normal) and it will tell you the coordinates of the window in restored state. These may be different from the current ones e.g. when the window is maximized.
Oliver
|
|
|
|
|
I used CryptAcquireContext with MS_ENHANCED_PROV and then created an RC4 key. I want to export this key without any encryption. I tried using PLAINTEXTBLOB on CryptExportKey. It works fine on XP, but fails on 2000 (with Enhanced Provider installed) with error NTE_BADKEY.
m_sessionkey is valid at that point. I can export it using my public key.
The line of code:
<br />
if (!CryptExportKey(m_sessionkey, 0, PLAINTEXTKEYBLOB, 0, NULL, &length))<br />
{<br />
DWORD dwErr = GetLastError();<br />
LogError(dwErr);<br />
return false;<br />
}<br />
std::vector<BYTE > keydata;<br />
keydata.resize(length);<br />
if (!CryptExportKey(m_sessionkey, 0, PLAINTEXTKEYBLOB, 0, &keydata[0], &length))<br />
{<br />
DWORD dwErr = GetLastError();<br />
LogError(dwErr);<br />
return false;<br />
}<br />
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
not being an expert with microsoft's cryptoapi I would check if the key is generated with Exportable flag.
Might be also the Q228786 will be usefull for you. Don't have any more clue with great microsoft's CryptoAPI
|
|
|
|