|
can't seem to find it...
thanks.
|
|
|
|
|
Dear All,
Good Day ALL,
I have a problem in a program am working on, am using an OCX from microsoft in a MFC program this OCX is "Microsoft form 2.0 Label" the problem is when i run the program on my machine Background color of the label is the same as the BackGround color of the Main Form which is correct;But when i run it on Different Machine the Background color changes from Main Form Color plz help me how can i correct this.
Thank you all for help.
Best Regards,
Mohammad Zakarni
|
|
|
|
|
In the properties of the control, set the background color to:
-2147483633
(it'll change it to hex for you)
or you can do it via code:
CLabelControl* l = &this->m_yourLabel;
l->SetBackColor((long)GetSysColor(COLOR_3DFACE));
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Dear Nitron,
Thank you very much it worked...
|
|
|
|
|
Hi,
I am working on a program in which multiple controls use the system image list. My code looks like this:
<br />
SHFILEINFO sfi;<br />
HIMAGELIST hSystemImageList = (HIMAGELIST) SHGetFileInfo("a.txt", 0, &sfi, sizeof(SHFILEINFO),<br />
SHGFI_SYSICONINDEX | SHGFI_SMALLICON);<br />
m_control1.Attach(hSystemImageList);<br />
m_control2.Attach(hSystemImageList);<br />
Attaching the first control to the system image list works ok. Attaching the second control results in a crash. Debugging points to the system image list attach.
Does anyone know what the problem is and how to solve it?
Thanks,
Woody
|
|
|
|
|
Problem: I would like to implement the following in MFC: Open a file using a program (for example, open a text file using Excel). That is, the same functionality as right-click on a file, select 'open with' and select the program. The file type will not be associated with this program.
I have succeded using ShellExecuteEx, and starting the executable file with the text file as parameter, but the limitation is that I have to know the locatation of the program executable, which can vary.
Grateful for help
/Stefan
|
|
|
|
|
I tried Start->Run "excel.exe c:\mydoc.xls" and it worked fine, without adding at all the app path. So I am not sure you actually need the app path.
In case you need it (for fun), just look up the registry HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
I declare this below Array.
------------------------------------------------------------------
CArray<unsigned char,="" unsigned="" char=""> m_data;
typedef CArray<unsigned char,="" unsigned="" char=""> CCharArray;
CArray<cchararray,cchararray&> m_Array;
------------------------------------------------------------------
I want to ask how to add m_data to m_Array.Which command I need to use?
|
|
|
|
|
SetAt, operato [] or Add, u chose
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thank you for your answer Papa. But it has some problem while compiling. I write this below program.
------------------------------------------------------------------------
typedef CArray<unsigned char,="" unsigned="" char&=""> CCharArray;
CArray<cchararray,cchararray&> m_Array;
CArray<unsigned char,="" unsigned="" char&=""> NewElement;
unsigned char a='a';
unsigned char b='b';
NewElement.Add(a);
NewElement.Add(b);
m_Array.Add(NewElement);
------------------------------------------------------------------------
While compiling there are this error message happen at this line
m_Array.Add(NewElement);
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(443) : error C2582: 'CArray<unsigned char,unsigned="" char="" &="">' : 'operator =' function is unavailable
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(1566) : while compiling class-template member function 'void __thiscall CArray<class carray<unsigned="" char,unsigned="" char="" &="">,class CArray<unsigned char,unsigned="" char="" &=""> &>::SetAtGrow(int,class CArray<unsigned char,unsigned="" char="" &=""> &)'
Error executing cl.exe.
BallotExtractandPrint.exe - 1 error(s), 7 warning(s)
Do you know how to solve my problem?
|
|
|
|
|
try:
CCharArray NewElement;
CArray <CCharArray,CCharArray> m_Array;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I strongly suggest you use a std::vector of std::vector
Best regards,
Alexandru Savescu
|
|
|
|
|
I would like to using the SetCooperativeLevel function in window mode
Example Fullscreen mode => DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN
result => I can use the CreateSurface function(return of CreateSurface function DD_OK).
Example Window mode => DDSCL_NORMAL
result => I can't use the CreateSurface function(return of CreateSurface function DDERR_NOEXCLUSIVEMODE).
What I do?
Example Window mode => (what parameters?)
|
|
|
|
|
U must add DDSCL_EXCLUSIVE when DDERR_NOEXCLUSIVEMODE is returned, so i guess
DDSCL_NORMAL | DDSCL_EXCLUSIVE
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
DSCL_NORMAL
This flag cannot be used with the DDSCL_ALLOWMODEX, DDSCL_EXCLUSIVE, or DDSCL_FULLSCREEN flags.
|
|
|
|
|
In Window mode, you don't call SetCooperativeLevel at all.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
What I can do when I would like to create the DirectX in window mode, Have you an example?
|
|
|
|
|
Papa, no need to dump MSDN here . I expect someone willing to do DirectX stuff to download the DirectX SDK (or platform SDK), where there are plenty of windowed samples.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Guess u have a point here
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
HI..
Just a quick question:
If I used visual C++ wizard to build a project n workspace for example TESTING...
How do i go about changing the name TESTING to another name like TESTING2...
'cuz it seems like i can't simply change the filenames of the visual C++
like this..
Testing.dsw -> testing2.dsw
Testing.cpp -> testing2.cpp
etc..
Thanks in advance.
|
|
|
|
|
The problem is that when you rename Testing.dsw, and the other files, the settings in testings.dsw do not change. You will have to rename the files then add them back to the workspace and remove the original names. Hope that answered your question.
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
Editing the DSW and DSP file and replacing the occurence of testing with testing2, then renaming testing.cpp to testing2.cpp is enough
but i guess there's a tool on CP that just does that, search a bit!
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
http://www.codeproject.com/tools/vsrename.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi all.
Does visual c++ support tooltips (does it provide built in support)? I am sure that it doesn't but maybe i have missed something?
I was told by someone that it does and that it is very easy to do. But I have a feeling that they are talking about visual basic.
Also, does .net have built in tooltip support?
In all the time I have been using VC++ 6 I have never noticed the support in MFC apps.
|
|
|
|
|
From VC6 IDE
Project->Add To Project->Components and Controls->Visual C++ Components->ToolTip Support
is one way to do it.
Michael
"Time and tide melts the snowman."
-- The Doctor (Doctor Who: Time and the Rani
|
|
|
|