|
See GetMenuItemRect()
How do I print my voice mail?
|
|
|
|
|
Hockey,
??GetMenuItemRect()??
I can't find any function that goes by that name! I got GetMenuItemCount, GetMenuItemID, and GetMenuItemInfo, but no GetMenuItemRect
Where can I find it?
thanks
|
|
|
|
|
|
Sorry to both of you,
I just realize I forgot to mention that I'm working with Windows CE (Microsoft embedded Visual C++). That function is not available on Windows CE .. So is there another way to do it?
thanks
|
|
|
|
|
|
I have recently found out (today) how to put an icon on a button. But the icon is 16 x 16 and it's bigger on my button that it usually is when viewed anywhere else, like in Windows Explorer, so it looks like crap. Is there a way, without bit-blitting that I can make the icon size to fit the button if I make the button smaller?
[insert witty comment here]
bdiamond
|
|
|
|
|
Find a class here on CP that does what you want
or
DrawIconEx()
How do I print my voice mail?
|
|
|
|
|
That isn't enough info to go on, can you post how you load the icon (LoadIcon, LoadImage, or something else?), how are you getting the icon on the button (using a class from CP, somewhere else, or is it your own code?).
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"Just because the box has 2 gigabytes of memory doesn't mean you get to use it all!"
-- Rico Mariani, CLR perf guy
|
|
|
|
|
this is the code I'm using:
m_cmdAddLink.SetIcon(theApp.LoadIcon(IDI_ADDFILE));
where m_cmdAddLink is the CButton variable for the command button
[insert witty comment here]
bdiamond
|
|
|
|
|
|
That worked perfectly. Thanks!!!
[insert witty comment here]
bdiamond
|
|
|
|
|
Hi,
I have a bug related to mouse messages in my mfc app. I have lbuttondown and rbuttondown handlers for my cscrollview, and the scroll wheel on a mouse seems to be automatically hooked up to the scroll position of the view, so everything works fine when using a regular mouse.
When using a notebook touchpad the lbuttondown and rbuttondown handlers work as expected, but I get a problem when both BOTH left and mouse buttons are pressed simultaneously. This causes neither the lbuttondown nor rbuttondown messages to be sent, nor does it send the mbuttondown message. But it is obviously sending some sort of message to the program because the cursor changes to an icon similar (but not identical) to the one that appears when you use the scroll wheel on a normal mouse. Unfortunately the program immediately crashes when both buttons are pressed simultaneously on a notebook touchpad. This behaviour doesn't occur if you press both buttons simultaneously on a normal mouse.
Does anybody know what message handler I should be using the capture the problem behaviour?
Thanks for any help!
Mick
|
|
|
|
|
I have a CListCtrl object with LVS_EX_SUBITEMIMAGES included in extended style. This will let me include images inside subitems.
The subitem images are displayed fine
I don't want images inside the first column, but it does display image 0. After setting that id to -1 the list doesn't display an image but it keeps a space inside the first column as wide as the images.
What can I do to prevent this?
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
Hello,
I need a hint how to copy files from virtual folders.
My digital camera is connected as virtual folder in 'my computer' -> 'control panel' -> 'scanners and cameras'.
It is not difficult to gain access to that camera by using iterative IShellFolder commands. GetDisplayName generates a full path like:
'::{GUID of my computer}\::{GUID of control panel}\::{GUID of scanners and camera\devid:{GUID of camera}\0003:\0003\Root\Ext0\DCIM\100Ricoh\picture1234.jpg'
SHOperation fails when passing this path.
Any help is appreciated.
Thanks in advance!
Sebastian
|
|
|
|
|
After I connect my camera to the computer, the drivers create a drive letter for it. In this case, it's always E:, so I can copy files all day long from drive E:.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
you are right, some cameras create volumes.
Any helpful comments?
|
|
|
|
|
sieppl wrote:
Any helpful comments?
No, I was just offering a suggestion that you obviously already considered.
Perhaps you could use CreateFile() , specifying the driver or device name as the first parameter. In the registry, try looking in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_040a&Pid_0571\KCKCL35220205\Device Parameters key for your camera's symbolic name. Note the values in red will be different on your machine. For example:
HANDLE hFile = CreateFile("\\\\.\\USB#Vid_040a&Pid_0571#KCKCL35220205#{a5dcbf10-6530-11d2-901f-00c04fb951ed}\\PIPE01", ...);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
okay thanks. i'll try that.
|
|
|
|
|
Hello All,
I have a program that is doing something and stop doing whatever he's doing and look at something else every 10 mins ( whatever the time is)
so I used OnTimer. No problem for certain times but at one point I got following error message.
Unhandled exception at 0x7c28ef6a in SMPServer.exe: 0xC0000005: Access violation reading location 0x00000020.
here the code that I wrote.
Why do I get the error after calling the DoSomething() for several times and died at next time DoSomething() gets call again? I tried killing Timer in DoSomething() and the result is the same. DoSomethings() gets called several times (probably 3 or 4 times) and die at next time. Am I missing something or am I using timer in wrong way?
<br />
int m_nTimer;<br />
const int TimerID = 1;<br />
const int Timeout = 5000;<br />
<br />
BEGIN_MESSAGE_MAP(CSMPServerDlg, CDialog)<br />
...<br />
...<br />
ON_WM_TIMER() <br />
..<br />
..<br />
END_MESSAGE_MAP<br />
<br />
void CMyDlg::DoSomething()<br />
{<br />
....<br />
m_nTimer = SetTimer(TimerID, Timeout, NULL);<br />
.....<br />
}<br />
<br />
void CMyDlg::OnTimer(UINT nIDEvent) <br />
{<br />
CDialog::OnTimer(nIDEvent);<br />
KillTimer(m_nTimer); <br />
if (nIDEvent == TimerID)<br />
{<br />
isStillTalking = false;<br />
PostMessage(WWPrinting); <br />
} <br />
}<br />
|
|
|
|
|
Remember that timers are a limited global resource. I forget the exact number that can be in existence at any one time but it wasn't very many.
Contrary to some documentation, the timer ID, not the SetTimer() return value, must be used when killing the timer.
Just curious but why do you continually call SetTimer() and KillTimer() ? Wouldn't it be sufficient to call each just once?
Also, the call to the base class implementation of OnTimer() is not necessary if nIDEvent is your timer.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi!
I wonder how I could use STL with visual C++ 6.0? I have used STL together with Dev C++(Cygwin) and it works fine. But when I try to run under Visual C++ it generates alot of errors. Any suggestions on how to solve this? Do i need some upgrades?
regards
M_A
|
|
|
|
|
STL support in MSVC++ 6.0 is certainly poor, but still you can use it without too many hassle. If you encounter a particular problem post it here and perhaps we'll be able to help you.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
M_A wrote:
But when I try to run under Visual C++ it generates alot of errors
what are the errors?
Software | Cleek
|
|
|
|
|
Hello M_A,
Please check to see if the errors you mentioned are actually warnings.
I believe alot of Visual C++ 6.0 users who use STL will certainly have encountered many warnings during compilation. Apparently alot of these warnings can be ignored. The usual recommendation is to use the #pragma warning preprocessor command to ignore the warnings.
I've encountered articles written by well-known authors who advocate this.
Hope this helps.
Regards,
Bio.
|
|
|
|
|
Hello again!
This is an extraction from one of my projects and it works perfect on Dev C++, but not on Visual C++ 6.
.................................
#include <iostream>
#include <iomanip>
#include "jumper_info.h"
using std::cout; using std::endl;
using std::cin; using std::ios;
bool compare (const Jumper_info& a, const Jumper_info& b);
std::ostream& operator << (std::ostream& out, std::vector<jumper_info>);
int main ()
{
int count=0;
Jumper_info temp;
vector<jumper_info> theJumpers;
theJumpers.reserve(20);
vector<double> points;
while(cin >> temp) {
calculate_result(temp);
theJumpers.push_back(temp);
}
std::sort(theJumpers.begin(),theJumpers.end(),compare);
int counter=0;
for(vector<jumper_info>::const_iterator i =theJumpers.begin(); i !=theJumpers.end();i++) {
counter++;
cout <<counter <<="" "="" *i;
}
="" return="" 0;
}
this="" file="" alone="" generates="" the="" following:
...........................................................
eader\main_uppg2.cpp(39)="" :="" error="" c2039:="" 'sort'="" is="" not="" a="" member="" of="" 'std'
c:\temp\0901\reader\main_uppg2.cpp(39)="" c2065:="" undeclared="" identifier
c:\temp\0901\reader\main_uppg2.cpp(42)="" c2653:="" 'vector<struct="" jumper_info,class="" std::allocator<struct="" jumper_info=""> >' : is not a class or namespace name
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2065: 'const_iterator' : undeclared identifier
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2146: syntax error : missing ';' before identifier 'i'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2065: 'i' : undeclared identifier
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2440: '=' : cannot convert from 'struct Jumper_info *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2446: '!=' : no conversion from 'struct Jumper_info *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2040: '!=' : 'int' differs in levels of indirection from 'struct Jumper_info *'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2146: syntax error : missing ')' before identifier 'i'
c:\temp\0901\reader\main_uppg2.cpp(42) : warning C4552: '!=' : operator has no effect; expected operator with side-effect
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2059: syntax error : ';'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2059: syntax error : ')'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2143: syntax error : missing ';' before '{'
c:\temp\0901\reader\main_uppg2.cpp(44) : error C2100: illegal indirection
...............................
I also get problems with getline in the following part.
getline(in,jumper.name,'\n');
Thanks for all the help!
|
|
|
|