|
Hi,
I use Visual C++ .NET 2003 under WinXP. For whenever I
create a new MFC project and add any control such as a
button, the interface is not XP style. All buttons are
in Win9x style.
I used Visual C++ .NET prior to upgrading to .NET 2003.
The older version works and the projects that were
converted to Visual C++ .NET 2003 have XP style.
Again, the problem is that Visual C++ .NET 2003 creates
new MFC projects under WinXP without XP style buttons. Is
there a setting that fixes this possible problem?
Thanks,
Kuphryn
|
|
|
|
|
i created a tree and a add button which will add the the selected item in the tree to a listbox. wat functions do i have to use and how to code them?
|
|
|
|
|
Hi,
here I was trying to open two Recordsets with one Connection. but I got _com_error message that it is not allowed to open two Recordsets with one Connection. Then I tried two Connections, but something is wrong,
could anyone explain me how to have multiple Recordsets, or Connections in one application?
And, Why I fail to move to previous Record in VIEW? Isn't it possible to move to previous Record which reads from the VIEW?
Respecfully,
exceter
|
|
|
|
|
Hi all,
How can i dynamically create a 3D array ? I have tried using new operator. But apparently it only support the dynamic creation of the first dimension.Can someone help me?
Thanks
Mahesh
|
|
|
|
|
The short answer is because the syntax to do so is horrible, you can use much nicer tools to do it for you. I believe this will do what you want. Note the use of the delete[] operator to delete arrays.
int dx = 2;
int dy = 2;
int dz = 2;
int x = 0;
int y = 0;
int*** pMatrix = 0;
pMatrix = new int**[dx];
for(x = 0; x < dx; x++)
{
pMatrix[x] = new int*[dy];
for(y = 0; y < dy; y++)
{
pMatrix[x][y] = new int[dz];
}
}
for(x = 0; x < dx; x++)
{
for(y = 0; y < dy; y++)
{
delete[] pMatrix[x][y];
}
delete[] pMatrix[x];
}
delete[] pMatrix;
I think you'll agree that this is much nicer.
vector<vector<vector<int> > > matrix;
matrix[0][0][0] = 1;
However if you need to do alot of matrix math then I strongly suggest you look at something like boost::uBlas which uses template proxy classes to eliminate the expensive copies that are the price of using vectors.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi,
does anyone have already done some games or software using iJen libraries?
For those who might know it yet, iJen is a motion detection system. Like the sony eyetoy, but for PC and doesn't require a special camera like the sony system.
It's working with a basic web-cam.
Plus, it's an open source, totally free for non-commercial use.
You can get free as well as some other free software at http://www.syfi.co.uk.
I'm a beginner in development and I'm looking for someone who might already used it to help me.
Let me know if you can.
|
|
|
|
|
Hi,
I have written a small dialog application that works fairly well, but I have noticed that under Windows XP the menu doesn't display correctly. It's only a minor thing, but behind the text on the menu, it is white, even though it should be grey (or whatever colour the theme has set). I have seen this in some other programs too (though not many), and have also seen it asked here before though with no reply/solution
It's only a very minor thing as it is purely aesthetic and does not affect the functioning of my program, but it would be great if I could get rid of it as it looks a little unprofessional.
Does anybody know how I can make the menu appear correctly on XP? My program is just a dialog based Win32 app with no MFC...
Many thanks for any suggestions.
Cheers,
KB
|
|
|
|
|
What you see is a well-known bug in XP. There are three things required to trigger the behavior you describe: 1) a dialog-based app; 2) XP and 3) themes enabled. There is a CMenu replacement here on CP that corrects this bug: Owner Drawn Menu with Icons, Titles and Shading. Try the dialog sample, and you will see that it works correctly.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
You can try to write "*.manifest" file for your program.
With this file your program will appear in 2000-look in Win2000 and with XP-look in WinXP. Your controls also will change their appearance and look.
You can see "Using Windows XP Visual Styles" topic in MSDN.
1) Add a file called YourApp.exe.manifest to your source tree that has the following XML format:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestversion="1.0">
<assemblyidentity
version="1.0.0.0"
processorarchitecture="X86"
name="CompanyName.ProductName.YourApp"
type="win32"
="">
<description>Your application description here.
<dependency>
<dependentassembly>
<assemblyidentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorarchitecture="X86"
publickeytoken="6595b64144ccf1df"
language="*"
="">
2) Add the manifest to your application's resource file as follows:
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.exe.manifest"
yiy
|
|
|
|
|
Using a .manifest file will not fix the XP menu bug.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Thanks for the replies, much appreciated. Does this mean that if I created an owner-drawn menu instead of creating one in the dialog editor, it would show correctly? (That is, if it is okay to mix an owner-drawn menu with a dialog-based app...)
Many thanks,
KB
|
|
|
|
|
Hello,
I've written a class that 'reads' Mp3 files. It all works fine, but when a Mp3 has VBR, my calculations are incorrect!
My question:
Is there a site or something where I can find onformation on VBR?
I didn't find any...
thanks in advance!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Well this isn't exactly C++ but...
I have a game (made in C++ using DirectX, so there.. C++ :P) and it encapsulates java scripts to extend its functionality. Now i was wondering if there's any way to see if a key is being pressed in java, without using the window event stuff, cause i cant create a window since its encapsulated in the game. I've looked on sun through the documentation but i can't find anything providing something to read the keyboard state, or an event model that works without creating a window first or whatever. Anyone know if its possible?
Kuniva
--------------------------------------------
|
|
|
|
|
How are you doing the embedding (also, are you using Java or JavaScript? It's not entirely clear)? I would think that the easiest way would be to just keep track of the key events in the C++ side and pass those along to the Java/JavaScript side (or rather, the Java/JavaScript side would query the C++ side for the key states).
- Mike
|
|
|
|
|
um, well the game isn't a game i wrote, its just a commercial game i have. It just links to the java scripts and provides basic events like ie clicked() which occurs when a player is clicked. The scripts are used to write mods and thus extend game functionality. An entire set of classes and functions are provided for this which link back to the main executable. I don't know much about using java in a C++ app so i don't know how exactly it's done. But so i can't just keep track of the key events in the C++ side.. I need to have a way to do this from the scripts... but i suppose it's not possible
oh and its Java, not Javascript
|
|
|
|
|
The architecture you describe is almost impossible to believe !!! That someone would interface java classes into a C++ game to provide user extendable functionalilty is implausible to say the least. I suspect that you are confused. However in case you are not
java.awt.AWTKeyStroke / javax.swing.KeyStroke is what you are looking for.
http://java.sun.com/j2se/1.4.2/docs/api/
|
|
|
|
|
Thank you.
About the game.. It really is the way i described it, the game is Vampire: The Masquerade - Redemption from Nihilistic Software. Many RP games implement some sort of scripting feature these days to let users add modules and all (like NeverWinter Nights for example). Just with Vampire, they chose to use Java instead of inventing their own scripting language for it. I'm guessing it loads all classes on startup in the JVM (A javai.dll is included in the root directory of the game) and the dll maps the function calls to the executable and vice versa. When u make a script u just have to make sure u derive it from a base class (in most cases Codex) and then there's subclasses for things, players, actors, regions, sectors, sounds, items, disciplines and so on.
Kuniva
--------------------------------------------
|
|
|
|
|
Ok here is the code...
<code> m_strOut = "scrollbar-darkshadow-Color:"+m_str1+";\r\n"+
"scrollbar-3dlight-Color:"+m_str2+";\r\n"+
"scrollbar-arrow-Color:"+m_str3+";\r\n"+
"scrollbar-base-Color:"+m_str4+";\r\n"+
"scrollbar-face-Color:"+m_str5+";\r\n"+
"scrollbar-highlight-Color:"+m_str6+";\r\n"+
"scrollbar-shadow-Color:"+m_str7+";\r\n"+
"scrollbar-track-Color:"+m_str8+";";</code>
and when I changed it to...
<code> m_strOut = "<style>\r\n"+
"{\r\n"+
"scrollbar-darkshadow-Color:"+m_str1+";\r\n"+
"scrollbar-3dlight-Color:"+m_str2+";\r\n"+
"scrollbar-arrow-Color:"+m_str3+";\r\n"+
"scrollbar-base-Color:"+m_str4+";\r\n"+
"scrollbar-face-Color:"+m_str5+";\r\n"+
"scrollbar-highlight-Color:"+m_str6+";\r\n"+
"scrollbar-shadow-Color:"+m_str7+";\r\n"+
"scrollbar-track-Color:"+m_str8+";\r\n"+
"}\r\n"+
"</style>";</code>
I get an error : error C2110: cannot add two pointers.
I don't know what is the problem.
HELP!!!!
<marquee>Universal Project</marquee>
|
|
|
|
|
You can't concatenate ptrs in a CString. So:
m_strOut = "abc"; is ok but m_strOut = "abc" + "def"; isn't. You can resolve this with:
m_strOut = "abc";
m_strOut + "def";
or:
m_strOut = "abc" + CString("def");
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Thankyou I solved it by doing:
m_strOut = "<style>\r\n{\r\nscrollbar-darkshadow-Color:"+m_str1+";\r\n"+
"scrollbar-3dlight-Color:"+m_str2+";\r\n"+
"scrollbar-arrow-Color:"+m_str3+";\r\n"+
"scrollbar-base-Color:"+m_str4+";\r\n"+
"scrollbar-face-Color:"+m_str5+";\r\n"+
"scrollbar-highlight-Color:"+m_str6+";\r\n"+
"scrollbar-shadow-Color:"+m_str7+";\r\n"+
"scrollbar-track-Color:"+m_str8+"\r\n}\r\n</style>";
<marquee>Universal Project</marquee>
|
|
|
|
|
But
";\r\n"+"scrollbar-3dlight-Color:" shouldn't compile.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I think it works because of the evaluation order, i.e.:
"<style>\r\n{\r\nscrollbar-darkshadow-Color:"+m_str1 Results in a CString, then
(previous CString) + ";\r\n" results in another CString, so the following concatenation is a CString + a const char* .
- Mike
|
|
|
|
|
I guess it does compile since I did it If you want I'll send you the source.
I think the \r\n makes it posibble I think. Send me an email if you want the source or executable.
<marquee>Universal Project
|
|
|
|
|
I have heard about TWAIN to scan an image.
Looking in codeproject and codeguru i saw samples about it.
However, those samples use the vendor UI.
I need to scan an image without using the vendor UI.
I need to set the resolution as well.
I will appreciate getting a sample.
Thanks in advance,
Dudi
|
|
|
|
|
what does "scan" mean? to get buffer of the image, or scan the buffer?
includeh10
|
|
|
|