|
usally one calls dynamic an array whose size can grow.
If this is your requirement then have a look to CArray or (even better) std::vector documentation.
If you simply need a two-dimensional array of CString , then you've already done:
int i, j;
CString sMyArray[2][3];
for (i=0; i<2; i++)
{
for (j=0; j<3; j++)
{
sMyArray[i][j]="foo";
}
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
How to create .dll and .lib files in a single build in VS2005. Is there any need to include some files for that ? Please help me.
|
|
|
|
|
What's your problem exactly ? Where are you stuck ?
You need to create a dll project (New Project -> 'Visual C++' -> 'Win32' -> 'Win32 PRoject'). Click next and you'll be able to select DLL as application type.
The library file will be generated automatically once you have at least one exported function.
|
|
|
|
|
Hi. Thanks for the reply.
My problem is i am creating a new project in VS2005 from the existing project of VC6.0. It is not able to create the .lib automatically with the dll. I have checked all the settings of the project but could not get success.
So i wanted to know whether any new thing has to be done in VS2005 while converting the old project to create dll ?
|
|
|
|
|
Do you have at least one exported function ( one that is starting with __declspec(dllexport) ) ?
Did you use the conversion wizard to convert from the VC6 project to the VS2005 project ?
|
|
|
|
|
Yes i have the following function with __declspec()
#define SS_NOTHROW __declspec(nothrow)
and yes. i have used the option File -> New -> Project from ExistingCode... option while creating
|
|
|
|
|
Y K Kishore Kumar wrote: #define SS_NOTHROW __declspec(nothrow)
First that's not a function and second, this macro doesn't even export a function.
Just to make a test, add this piece of code to one of your header file:
int __declspec(dllexport) Test()
{
return 42;
}
|
|
|
|
|
Great.
Its working now. thankyou very much.
But can u please explain the scenario if u have time. ? Because some projects are working without this function.
Once again thankyou verymuch.
Kishore.
|
|
|
|
|
Y K Kishore Kumar wrote: Because some projects are working without this function.
You need to export at least one function so that the lib file will be generated. In your case, if no lib file is generated, it means that no function has been exported. So, it means that your dll is useless (a dll that doesn't export anything is completely useless). If you need to add this function to have a lib file generated, then I think you have a problem.
|
|
|
|
|
OK. got it. thankyou very much once again.
|
|
|
|
|
Hi
I want to ask that is that possible to display a picture with jpeg format in visual c++?If it is possible how can I do that?
Thanks
|
|
|
|
|
Simple: Under the green bar at the top of the codeproject page is a input filed labeled "Search".
Just enter "jpeg" in that field and press "Return".
Et voila!
You get any number of articles about reading, decoding and displaying jpeg pictures. Try out a few solutions and produce your personal blend.
Failure is not an option - it's built right in.
|
|
|
|
|
jhwurmbach wrote: Simple: Under the green bar at the top of the codeproject page is a input filed labeled "Search".
Just enter "jpeg" in that field and press "Return".
|
|
|
|
|
JPEG format is the compressed file format. Please refer details here[^].
Regards,
Paresh.
|
|
|
|
|
Yes you can use of CImage class for show bmp,jpg,gif,png and also use of GDI+ after load use of WM_ERASEBKGND for show it
|
|
|
|
|
Is better you see a short code
#include atlImage.h
CImage m_Image;
m_Image.Load(filename);
m_Image.BitBlt(dc.m_hDC,CRect(0,0,640,480),CPoint(0,0));
m_Image.Detach();
|
|
|
|
|
There is a button with image. When I click the button, the dotted lines denoting the focus of a button is coming and
part image becomes invisible and if I click somewhere else in the dialog then also part of image is not becoming visible.
The code is as follows:
CButton *cb = ((CButton*)GetDlgItem(IDC_BUTTON2));<br />
bmpForBtn = CreateMappedBitmap(AfxGetInstanceHandle(),IDB_BITMAP1,0,&clrMap,1); <br />
cb->SetBitmap(bmpForBtn); <br />
Any ideas would be greatly appreciable.
Best Regards,
Suman
|
|
|
|
|
That code looks ok . You have not given the details of clrMap. At which point you are calling this ?? (and hope you may checked the property bitmap of the button in resource editor to true, if not do it. )
If u can Dream... U can do it
|
|
|
|
|
rp_suman wrote: = CreateMappedBitmap(AfxGetInstanceHandle(),IDB_BITMAP1,0,&clrMap,1);
Is there any reson for using this API ? Its documentation says, Creates a bitmap for use in a toolbar .
Prasad
MS MVP - VC++
|
|
|
|
|
I am using that API to apply the bitmap source image to button control.
Best Regards,
Suman
|
|
|
|
|
rp_suman wrote: I am using that API to apply the bitmap source image to button control
Yes, I know that, but there are lot others availables, like LoadBitmap .
Prasad
MS MVP - VC++
|
|
|
|
|
Hi,
In my application i have made a menu which displays menu items along with the associated bitmaps during run time.My Problem is when i move mouse over the menu items the bitmaps are not dispalying properly.They are appearing as shading.How can i rectify this.
Thanks.
|
|
|
|
|
I've been using VC++ 6 and office 2003 for a long time without any problem.
But when I install office 2007, my VC++ 6.0 cannot open file or add file to existing project, but it's still able to open workspace, create new project, compile, run, ... do everything else perfectly !!! But any time I choose File/Open or Project/Add to project/Files then visual C shutdown immediately without saying anything !!! It just closes like it was killed !
Uninstall office 2007 and things go back to normal.
Have any one suffered the same situation ??
|
|
|
|
|
Am working on EVC . Am using the following function to get the battery level but am getting an error .
Function used :
SYSTEM_POWER_STATUS_EX2 SPSE;
GetSystemPowerStatusEx2(&SPSE, sizeof(SPSE), true);
Error :
error C2065: 'GetSystemPowerStatusEx2' : undeclared identifier
error C2065: 'SPSE' : undeclared identifier
Please help me out in this . Thanks
|
|
|
|