|
I have been programing in c for sometime and just recently am going to c++ for school. I have Microsoft Visual c++ as a compiler...My question is can i use regular C code or C++ code without problems or will i have to learn Visual c++ i do anything....Basically is what i am asking is it backward capatible with c and c++
|
|
|
|
|
Hello,
You can use Win32 Console based application project type for C or C++ program with out any problem.
Tith Regards,
R.Selvam
|
|
|
|
|
Strider_2001 wrote:
My question is can i use regular C code or C++ code without problems...
Both are fine.
One thing to remember is that a .C file can only contain C code, while a .CPP file can contain both C and C++ code.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi All
I have a MFC client wich is a part of big 3-tier application. Recently, I've begun to convert some parts of it into managed code.
By that, I mean that I rewrote some components of the app using C# and imported them into my app as a COM components (including the communication with the server wich I changed from COM+ to .Net remoring).
It works fine, but when I close the application I get exception in call to corExitProcess().
Does anybody know something about that?
Do I have to shut the CLR in some way?
thanks!
|
|
|
|
|
Hi!
I have to do a CORBA interface for my Visual C++ application and I have no idea. What should I do? How could I start? Where could I find some information about this? Any advice will be welcome.
Could I ask questions about this here or is there any other board for this theme?
Thank you in advance!
|
|
|
|
|
It's not that different from creating a COM interface for you application (in fact, that's one path you can take: create a COM interface and use a COM/CORBA gateway app). You design an interface for the application (that is, the services it will provide to other applications) in IDL. You then run the IDL through the IDL compiler provided by your Object Request Broker (for a COM object you run the IDL through MIDL). The IDL compiler will generate code that has the C++ interfaces to the functions you described in IDL. You write the implementation of those functions, using the rest of your application. Then you link that together with your application and libraries provided by the ORB vendor.
Usually, if you are being asked to do this your employer will have an ORB in mind. You'll have to get details from the ORB documentation. I think there are at least one or two open source ORBs around, as well.
|
|
|
|
|
Suppose I have the same icon in 3 different formats: 4, 8 and 32 bits. How do I load them with a specific bit depth using the win32 API? I want to do something like this:
HICON hIcon4 = Load4BitIcon(IDI_ICON, ...);
HICON hIcon8 = Load8BitIcon(IDI_ICON, ...);
HICON hIcon32 = Load32BitIcon(IDI_ICON, ...);
LoadImage just doesn't (seemingly) cut it.
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
I've had a quick look, and can't find a LoadIconDepth function either. What you might have to do is
use FindResource, LoadResource, and LockResource to get at the raw data, extract
the data for the colour depth you are after, and then create afresh using CreateIconIndirect.
Unless anyone else has any ideas?
I am a little puzzled as to why you want to though. Windows automatically loads in the icon
appropriate for your specified size, and screen colour depth with LoadImage.
Iain.
|
|
|
|
|
Iain Clarke wrote:
and then create afresh using CreateIconIndirect
I'm on it.. Found a nice article on icons at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_icons.asp[^]
Iain Clarke wrote:
I am a little puzzled as to why you want to though. Windows automatically loads in the icon
appropriate for your specified size, and screen colour depth with LoadImage.
Ah yes, but it seems that 32-bit icons are incompatible with various components such as image lists. When I use LoadImage() to prepare an image list, I often get "weird" artifacts in the icons when they are drawn in list boxes and the like. If I draw the icon myself with DrawIconEx() they turn out just fine, but not in common controls.
That's why I'd like to be able to specifically ask for an 8-bit icon, which I know renders perfectly.
If you know why list controls behaves this way with icons and know how to make it stop, then please, enlighten me. (I'm using WTL, but I don't think that's the problem since it only thinly wraps the system control)
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
Is this problem reproducible on other systems with different graphics drivers?
I ask because I was having a problem with toolbar button icons (for example, in IE and WinZip) with a previous version of nVidia's drivers with this system's Riva TNT card. Reverting to the version on the XP CD fixed it. The latest drivers appear to have fixed the problem.
Unless you can reproduce it on a number of other graphics cards/drivers, I'd blame it on the graphics manufacturer.
You could also see if it goes away if you reduce the hardware acceleration level.
|
|
|
|
|
You may want to try ExtractIconEx, passing the actual resource ID to load. An excerpt from the docs:
nIconIndex
Specifies the zero-based index of the first icon to extract. For example, if this value is zero, the function extracts the first icon in the specified file.
If this value is –1 and phIconLarge and phiconSmall are both NULL, the function returns the total number of icons in the specified file. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ICO file, the return value is 1.
V NOTE THIS SECTION V
Windows 95, Windows NT 4.0, and later: If this value is a negative number and either phIconLarge or phiconSmall is not NULL, the function begins by extracting the icon whose resource identifier is equal to the absolute value of nIconIndex. For example, use -3 to extract the icon whose resource identifier is 3.
Once the array of icons are loaded, you can simply pick index 0 for 8 bit, index 1 for 16 bit, index 2 for 24 bit, etc.
onwards and upwards...
|
|
|
|
|
As I read it, this won't help. The ExtractIconEx gets the icons from a file. A big and small icon for
each ICON. He can already load a particular dimension of icon from his own files using LoadImage.
What he needs to do is to pick a particular colour depth icon, when a ICON may have icons with the same
dimensions, but differing depth.
Unless I'm wrong. It's not *my* question to start with after all!
Iain.
|
|
|
|
|
I have created a 3D model and want to include a light source,
after I created it, the colour of the whole model changed to one colour...
moreover, the light source was not fixed in one position and changing all the time...
can anyone pls tell me how to fix this and provide me some examples??
thx very much~~
|
|
|
|
|
Hi,
I am looking for icons of different flags (spain, germany etc...)
Can anyone assist me in finding them?
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Graphics\icons\Flags
You might not have them installed, but they're definitely supplied with VS6 and both VS.NET versions.
|
|
|
|
|
I'd like to find the tutorial of using it Step-by-Step. About Rich Edit, serialization of data in this ctrl etc.
|
|
|
|
|
Hi,
http://www.codeguru.com/richedit/SyntaxColorizer.html
http://www.codeproject.com/richedit/
With Regards,
R.Selvam
|
|
|
|
|
Sir,
how can i get the processor's or Mainboard's serial no. Kindly guide me as soon as possible.
Regards,
Kashif Mughal
|
|
|
|
|
I'll leave the easy one to someone else;
To get the mainboard's serial number, power off, open the case and look on the biggest board you can see for anything that looks like a serial number.
Write it down.;P
Steve S
Well, it's Friday...
|
|
|
|
|
Not sure about the processor's serial number (does it have one?), but the system board's serial number can be obtained from the Win32_BaseBoard class.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I believe that P-III and later processors have serial numbers 'etched' into them, although it is possible to switch off or mask the ability to retrieve the serial number, normally in the BIOS. Don't know about AMD processors though.
Steve S
|
|
|
|
|
Ahh yes. I seem to remember that discussion causing so much stink in the "privacy" department.
Thanks.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I have created a 3D model and want to include a light source,
after I created it, the colour of the whole model changed to one colour...
moreover, the light source was not fixed in one position and changing all the time...
can anyone pls tell me how to fix this and provide me some examples??
thx very much~~
|
|
|
|
|
hi:
Recent there are some problems boring me ,which is how to read the CD_ROM sectors.As we all know ,there are three track mode. The first one is CD_DA ,which is Audio CD ,The second one is MODE1 ,the last one is CD_ROM XA ,which is MODE2 and has two form.
Now I can read the sectors which track mode is MODE1 or MODE2form1 with CreateFile and ReadFile API,but can't read other track modes with them. I want to read the sectors which track mode is ANY ONE with DeviceIOContrl and IOCTL_CDROM_RAW_READ,but I can't read anything.
This is my code.
hCD = CreateFile ("\\\\.\\H:", GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
lpSector = (unsigned char *)VirtualAlloc (NULL, dwSize,
MEM_COMMIT|MEM_RESERVE,
PAGE_READWRITE);
RAW_READ_INFO Info={0};
Info.DiskOffset.QuadPart=0;
Info.TrackMode=XAForm2;
//Info.TrackMode=YellowMode2;
//Info.TrackMode=CDDA;
Info.SectorCount=1;
DeviceIoControl(hCD,IOCTL_CDROM_RAW_READ,&Info,
sizeof(Info),lpSector,2352,&dwNotUsed,NULL);
Now the DeviceIoControl return 0,and there is no data in the lpSector
and my friend suggest me that I should use DeviceIOContrl and IOCTL_SCSI_PASS_THROUGH_DIRECT,but using them will bring a lot of questions
another question is how to differ the track mode.
Thank you very much
Regards
|
|
|
|
|
longdafeng wrote:
Now the DeviceIoControl return 0,and there is no data in the lpSector
Which means the function failed. What does GetLastError() return at that point?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|