|
<shameless_self_promotion>
Try this article[^].
</shameless_self_promotion>
Software Zen: delete this;
|
|
|
|
|
Thank-you so much Gary and Gerald for answering my post.
Gary.. your article is probably really fantastic for someone who's been at this a bit longer than me.. unfortunately it confused me like crazy (It works really great by the way) I feel like a real dough dough head right now!
However... persistance really pays off, as the sun is shining on me today ... I finally found an example (My search string on Google was totally by fluke) that works with the "Hello World" tutorials I've been reading. It loads a resource in the statement block "LRESULT CALLBACK WndProc", which is the coding I was learning for opening a straight forward window.
I'd love to share the code for others that may need it, but I can't explain what it's doing, so maybe one of the experts here could write an article on how to load a resource in a simple window based on the Hello World tutorials. <- That would be fantastic
Once again thanks alot.. this place is really awesome in regards to examples, and help.
|
|
|
|
|
Hi all;
I badly need a DialoogBar in my application. I have include the Dialog Bar included in "registered visual c++ components" to my project and it works just fine. The only problem is that i need to implement tab control on the DialogBar. In order to create, initialise and attach items to the tab control, i need to add a snippet. When i add the snippet in OnInitDialog for a modal dialog, it works fine. The problem is that the DialogBar is of style -> child (Not modal) and i really don't know which event to call to create the tabs on the DialogBar. Can somebody please help me on this thing. I really really need this very quick.
Thank you beforehand guys;
Krugger
|
|
|
|
|
Dll's I have used for years on NT 4.0 and 2000 now don't work. I had these installed on a
Windows 2000 system, where they worked well.
I've now migrated to a Windows XP (SP1) system, and re-installed there.
I now find that they do not work, and the
error I get is consistent with xxxxx.dll not being installed. When I try
using regsvr32 to register xxxxx.dll, I get "DLLRegisterServer entry
point not found".
Any ideas on how to fix this situation? (Apart from the obvious one blowing the %$#@#&^ xp box off the planet?)
Best Wishes,
ez_way
|
|
|
|
|
Hi
Does anyone know how to create a dll to store /retrieve bmp's?
Best Wishes,
ez_way
|
|
|
|
|
Create the DLL as a resource-only DLL. This article[^] in the MSDN should help. I found it using the search term "resource-only DLL" (quotes included). There's another article on the same topic that is VC6-specific, if that's what you're using.
Software Zen: delete this;
|
|
|
|
|
I need my program to test if caps lock is on or off
GetAsyncKeyState() and GetKeyState() dont work too well for testing if it's on or off, they GetKeyState() only seems to work once, GetAsyncKeyState only works when the capslock key is pressed. is there some other way i could check is caps lock is one or off?
|
|
|
|
|
GetKeyState() is what I use, and I have had no problems with it. Just make sure you check only the low-order bit.
BOOL bCapsOn = GetKeyState(VK_CAPITAL) & 0x01;
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
can you explain this low order bit and high order bit stuff to me?
when i use this, i just check if the return value is -32767, like i seen in a VB example of using GetAsyncKeyState
|
|
|
|
|
|
Hi there:
I am double buffering (CMemDC) a view in a multi-splitted window, and I am still seeing flickering in a control that is dynamically created (slider bar) in one of the double-buffered windows. When I create the control it is with the Create function and the parent CWnd is the view within the splitter.
Does anyone know what is needed to get rid of this flickering? Thanks
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
I think in your parent window you use the WS_CLIPCHILDREN | WS_CLIPSIBLINGS styles and your children should stop flickering.
I think anyways
HTH
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Hello,
I have an application that uses WTL classes,
I try to add buttons to CToolbarCtrl
CImageList images;
1.
images.Create(32, 32, ILS_ALPHA | LR_CREATEDIBSECTION, 0, 2)
2.
images.AddIcon(CIconHandle().LoadIcon(IDI_FILEMENU, 32, 32))
images.AddIcon(CIconHandle().LoadIcon(IDI_SETTINGSMENU, 32, 32))
3.
TBBUTTON(..)iBitmap = iIndex;
4.
ctrlToolbar.SetImageList(images)
... and buttons have black background (there where should be transparent), of course i could set bg color with
images.SetBkColor, but toolbar in XP might have gradient bg...
What i do wrong ?
How to add an icon, in order to paint it with transparency?
NodeX
|
|
|
|
|
I develop a program for handicapped people. (Sorry for my English, French)
I found to intercept all the messages of the mouse towards my program (with MOUSEHOOK in a Dll) but I still have a problem.
How to simulate that the left mouse button is down (remain inserted)
to help the people for move items or to select text etc...
Thank you for your assistance
Jm Berckmans (jeanmichel.berckmans@skynet.be)
|
|
|
|
|
A very good introduction to global hooks : http://www.flounder.com/hooks.htm[^]
Not having done what you want to do, this is just a guess. How about, when your user presses the left mouse button down, you set a flag in your dll, and while that flag is set you block all subsequent left mouse button messages until the user does whatever they have to to clear the flag. I believe you can block mouse messages by having your hook function return any positive value instead of returning the value returned by CallNextHookEx() .
Untested code, but this should give you an idea.
LRESULT CALLBACK MouseHookProc(int code, WPARAM wp, LPARAM lp)
{
LRESULT ret = CallNextHookEx(m_hMouseHook, code, wp, lp);
if (!m_bFlagSet && wp == WM_LBUTTONDOWN)
{
m_bFlagSet = true;
return ret;
}
if (m_bFlagSet && (wp == WM_LBUTTONDOWN || wp == WM_LBUTTONUP))
{
return 1;
}
return ret;
}
HTH
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
hai all
Is it possible to invoke an application ie already installed in another computer of a network using vc++.
Please help me
Thank you
|
|
|
|
|
Basically, yes, and no.
For example, if you had a computer on the network that has a program MyRunThis installed, and the folder in which the application is was shared, you could start the program by using ShellExec and a command string "\\computer_name\folder\MyRunThis.exe".
In order to run a program on a remote computer, it must be made available by some way. This means that if the target computer's application's folder is not shared or registered as a DCOM server, you cannot start it. This is a security issue, thus making it impossible to execute malicious code without a clear security vulnerability first available.
If the computer resides on a LAN, it shouldn't be a big problem for you to share the target folder, then use ShellExecute to start it. If you have access to the application's source code, register it to support Automation, and this will allow you to create an instance of the application by calling CoCreateInstance.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hello!
I'm not very good at vc++.
Could anyone let me know that how can I call up the Windows print dialog in vc++ (non MFC) ?
And how can I print out a MS Word/Excel doc. using the information retrieved from this print dialog ?
Many thanks for answering my question ! =^^=
|
|
|
|
|
Try using the ShellExecute function, with the operation argument set to "print".
Software Zen: delete this;
|
|
|
|
|
Thanks a lot for your help ! =^^=
I have already solved the printing problem by using "ShellExecute" !
However, it doesn't open the "Print" dialogue. Instead, it just sends the file to the default printer.
Would you like to let me know that how can I launch the "Print" dialogue by using "ShellExecute" also ?
Thanks a lot for your help again !
Betty
|
|
|
|
|
1. You need to find out details of the PrintDlg, PrintDlgEx and PageSetupDlg common dialog box functions.
2. You can't directly. You could save your settings as the default printer and settings (not sure about that last bit, but SetPrinter and stuff should help), and then call Word/Excel with print as an option on the command line - but then you've got to wait and restore the original settings, or the user will be mightily PO-ed.
Also, you'd have a problem printing just some of the pages that way. It might be possible to do it specifically for Excel and Word by using automation, but that feels like a large sledgehammer.
Steve S
|
|
|
|
|
is it possible to allocate more than 400 mb of phisical memory when your ram is only 512mb. i have successfully allocate about 360mb nothing more than that. why is that?
If you re expert on this one,please explain to me.
Thanks,
Shin
|
|
|
|
|
Even though Windows OS is a multi-tasking environment, and on the later versions (2000, NT, XP), it is capable of using the 'Virtual Machine' technology, you cannot allocate all memory for your programs.
The problem here is that even on the VM mode - Where every process of your computer believes it has all the system resources available, and a background process of Windows is taking care of processor time/memory allocation/swapping - the forementioned background process and Windows base services reserve a section of memory for private use. For example, the swap file reserves a piece of cache memory for itself to ensure optimized performance. Similarly, other base services such as HAL layer, Win32 API and SVC host take a piece of the available memory.
Thus, the resulting free memory is available for program use. On a Windows XP system, you can see the available memory from the Task Manager. As an example, my system has 1 GB of RAM memory, from which 707 Mb is currently available. Thus, ~300 Mb is taken by currently running applications and the background services. Putting all other applications to rest I can free up to 830 Mb of memory.
However, the base question is why on Earth do you need 400 Mb of RAM ? If you have a data store of that size, it is suggested to move it into a file or a database. This allows much smoother performance. Eating up RAM memory will slow down the performance of your machine, thus it should be used sparingly. Needless to say what a memory leak would do in this situation..
So, to answer your question: if you want all the 512 Mb of memory for your program's use, you must give up on Windows and/or Linux and use a non-resource hungry OS, such as Symbian OS. However, this will effectively reduce your program's visual output as well.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
confused:I can customize the existing CFileDialog by deriving a subclass from it. But the controls that i can drop into the extended CFileDialog dialog template are limited to only basic windows controls like EditBox,Buttons etc. I also watched that most of these controls are implemented in cmnctl32.dll library.Any attempt to embed any ActiveX control in the template simply shows up nothing - no file dialog.
|
|
|
|
|
I want to put a CButton control within a CReBar control.
I used the CReBar::AddBar method, but the Button appears disabled.
Is there another way to make this work?
Thanks!
|
|
|
|