|
I am interested to make an Installation of some COM objects, that should be configured to be launched as a certain user, how can I made it in a programmable way (not via dcomcnfg)?
thx
Jonathan
|
|
|
|
|
Go straight at the registry;
Under the key HKCR/AppID/YourObjectAppID make a new value called "RunAs", where you specify the user of your choice.
This can easily be done from a little C++ program, using the Reg* API.
Your object's AppID can be found under its CLSID in the registry.
HTH
Kim Gräsman
|
|
|
|
|
Part of my project is to search/replace or add text in large text files (over 4MB). The sequential approach seems to be very time consuming, therefore I started to think about other methods/procedures. Do you have/know any suggestions, www links, code snippets where I could start from?
Thanks in advance,
Stan
|
|
|
|
|
Look. I've worked with large files - it was 0.5 GB - 1.5 GB.
It was realy large and search and replace took hours with DOS-made program.
To impove it I compiled another program. One of the ideas was - first allocate enough memory. You probably can allocate all 4 MB in memory. Second, the program will work much faster if it will work not with bytes, but with DWORD.
So, I packed chars in DWORDs by 4 where it was possible.
Third, check only first DWORD, if it is equal, compare all.
Make a loop with offset by DWORD. After you passed all file, increment it, and so three times to make full search.
This algorithm a litle bit more complicated, but I've got speed of like it was just read and write - something like 10-15 minutes.
Hope this will help.
|
|
|
|
|
Is there anybody who has a chunk of code where I can see how to make items in a CListCtrl editable?
|
|
|
|
|
1. Single field editing (first sub-item) can be enabled due to flag in the ListCtrl properties
2. A general purpose editable ListCtrl could be find in the code guru section discussing ListCtrls
|
|
|
|
|
Hi.
I am sendind from a window a message to another window.
In the receiver window I use the PreTranlateMessage to get
the Message that the other window sends.
The broblem is that the receiver window gets the messages
grouped by 16!!!
For more details: i send a string on the wparam. For sure
i am sending diferent string but the second window get 16
times the last string.
Can anybody help me?
Thanx Soty
|
|
|
|
|
Why do not try WindowProc() instead of PretranslateMessage()?
|
|
|
|
|
Well, we sure have some responses and ideas. I personally like the idea of starting off by writing a VC++ plug-in that would let the user plan his project-bug lists, TODO lists, feature list and manage all this. Ofcourse, it's my opinion-so please everyone else voice your opinion.
As of now, Chris, Frank, Colin, myself and (Mark?) comprise of a group that's interested in taking this further. Who else is in?
|
|
|
|
|
Hi,
I like the idea, but I do not have any experience in writing plug-ins.
|
|
|
|
|
I'd like to think that another purpose of this group would be to help each other learn new things. Of course not everyone knows everything about everything, so this would be a great learning experience for all of us.
Frank
|
|
|
|
|
In the last three editions of the Kruglinski book "Programming Visual C++", (formerly "Inside Visual C++") there is an example of how to "nest" a common dialog into a custom dialog. In the example, the common file open dialog is nested into a custom dialog box. I am trying to do the same with a Page Setup dialog. I have taken very similar steps as outlined in the book, and converted file dialog specific steps to the page setup dialog. (Mainly passing my dialog template to the m_psd member rather than m_ofn member.)
The problem is that the dialog box appears to be "invisible". I can no longer control the parent window, but SPY++ tells me that my custom page setup dialog exists.
|
|
|
|
|
If I write a custom control and want it to source its own WM_NOTIFY messages, how do I determine values to use for notify-codes? Can I pick numbers out of a hat, or is there a preferred range? I note that MS controls use the range 0-950.
|
|
|
|
|
Use values great than WM_APP and you should be right.
|
|
|
|
|
Did any body try sample?
MSDN Library - April 2000/Platform SDK/User Interface Services/Windows Shell/Shell Prigrammers Guide/Samples/Band Objects
Is there any way to download this? I have to provide exact same functionality in my project.
regards,
Mahesh
|
|
|
|
|
I have written my own browser band extensions and I believe I looked at the sample you reference.
Of particular use is the article
"Creating Custom Explorer Bars, Tool Bands, and Desk Bands".
Search MSDN for "Explorer Band" to locate this. In my installation the search produces three results...
Good Luck!
|
|
|
|
|
I used the online version of MSDN:
http://msdn.microsoft.com/library/default.asp
There it gives you the html equivalent of all the code in the sample. You can just copy and paste it into your project.
Cheers,
Frank
|
|
|
|
|
Thanks Frank,
I tried it. But i got compilation errors. Can you send me running version of code if you still have it?
|
|
|
|
|
I got build errors too. I dont have the whole platform SDK installed though.
Maybe thats it.
Frank
|
|
|
|
|
|
It seems everyone has to do it the hardway everytime all the time. I've done a dozen+ band objects, I did so many that I got fed up of retyping the code all the time for the COM object. So... A couple months ago I wrote an ATL wizard that generates the deskband framework for you, all you need to do is change the registration code and the UI. I also list in my articles discussion column other sources of information. Look for it on CodeProject @
Creating DeskBands with an ATL Object Wizard
Making development easier,
-Erik
|
|
|
|
|
Anybody knows how to change window (or dialog window)
font in Visual C++ after it has been created?
Thank you,
Goran
|
|
|
|
|
Hi!
You need to send the WM_SETFONT message to the window. See MSDN for more details...
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Here is sample for dialog..
// get dialog font and create thin variation for control contents
HFONT hFont = (HFONT)::SendMessage(m_hWnd, WM_GETFONT, 0, 0L);
if( hFont ){
LOGFONT lf;
::GetObject(hFont, sizeof(LOGFONT), &lf);
lf.lfWeight = FW_LIGHT;
// check for attached font object already existing
if( m_cfFont.m_hObject || m_cfFont.CreateFontIndirect(&lf) ){
// if supposed to set the thin font
if( m_bThinFont ){
OnSetFont((CFont *)&m_cfFont);
}
}
}
void CGCDialog::OnSetFont(CFont *pFont)
{
HWND hWndChild = ::GetWindow(GetSafeHwnd(), GW_CHILD);
while( hWndChild ){
CWnd::FromHandle(hWndChild)->SetFont(pFont);
hWndChild = ::GetNextWindow(hWndChild, GW_HWNDNEXT);
}
}
|
|
|
|
|
Wow! That's terrific-after just voicing the idea of having a virtual development team, it's great to see so much enthusiasm! And to top it all, Chris-thank you for your support as well-especially for going the whole hog to express your interest in setting up mailing lists, project discussion boards et al. Thank you once again-we all really appreciate it
Okay, now I must say we have the following who are interested:
1. Frank Deo
2. Franky Braem
3. Myself (Shanker)
4. Chris-are you interested? Or are you too busy? It'd be an honor to have you.
5. And Widi....??
Okay, now...I need to know at what point we should start-how many folks should we have as part of the team? Or should we let it grow on an ad-hoc basis? (this can mean experiencing difficulties sync-ing people new to the team with what previous members have already been doing)
Once we have the team strength sorted out, WE NEED SOMETHING TO WORK ON!! Any ideas? Chris? Can you point us towards some interesting areas we could venture into? Once we have a bunch of items to select from, we could all vote on it to pick which one comes out tops.
So everyone, don't be shy-whatever your project idea-be it small or H-U-G-E, just post it in. But bear in mind that eager though we all are, we cannot start on it UNTIL we get a stronger team (strength-wise). I would assume we need atleast 7-10 people to start with. Once we have the team, we can work out other issues as where we shall be voicing our stuff-such as discussion/mailing areas-Chris has expressed his desire to help us in this regard.
Thanks all, and keep up the great spirit!
|
|
|
|