|
Hi...
I have a program written in MVS2005 (C++) - a form application. When I run it, it works just fine. But when I try to run the application on a computer without MVS installed it gives me this error: "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem".
Now... The computer I'm trying to run the application on has .NET Framework 2.0 installed, and my application has all the .dll-s needed in the same folder. I also tried with a Visual 2005 Redistributable package, but the error still pops up. I searched the internet for a solution and I found out I was supposed to include the dlls in my .exe . I did that, but still no result.
Can anyone please tell me how to make an application compatible with all computers (at least running on XP with SP2 and .NET framework 2 installed)?
|
|
|
|
|
Check the dependency of your executable. For checking dependency you need depends.exe, it can be found at MS VS6.0 installation.
Regards,
Paresh.
|
|
|
|
|
I'm an extreme beginner to C++... how do I clear data that I have the user input? Is there an easy function to do this? If I don't know how to do this should I even bother trying to ever learn C++?
Like you imagined when you were young...
|
|
|
|
|
eRose24 wrote: how do I clear data that I have the user input?
What kind of user input you are talking about ? Can you be a little clear ?
|
|
|
|
|
Can you say more explain what kind input?
|
|
|
|
|
Hello,
I have created a non doc-view application.In this MDI application I have a childview derived from CWnd.The window is created with window styles as WS_VSCROLL | WS_HSCROLL. And so I am getting vertical and horizontal scroll bars along with the window.
If I write the OnVScroll and OnHScroll function the pScrollbar pointer is NULL.
so I cannot handle any functions of pScrollbar .How to attach the pointer of CScrollbar to the scrollbar that I have with the window.
Prithaa
|
|
|
|
|
You can use CWnd::GetScrollInfo()/CWnd::SetScrollInfo() to manipulate the window's scrollbars.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hello,
Yes I have been to the Scrolling functions of CWnd class but once the window is made how are the pointers for the scroll bars attached to the scroll bars that I can see with the window.
It seems that the pointer is NULL for CScrollbar *pScrollbar which comes up when I call the function ONHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
And if I want to access the SetScrollRange in the OnCreate
function I get access violation error
Prithaa
with
|
|
|
|
|
For built-in scrollbars (WS_HSCROLL/WS_VSCROLL):
You don't use the CScrollbar pointer (obviously, since it's NULL).
For the CWnd::GetScrollRange/CWnd::SetScrollRange/CWnd::GetScrollInfo/CWnd::SetScrollInfo/etc.
methods, use SB_HORZ/SB_VERT for the nBar parameter to access the appropriate scrollbar.
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hi all,
I'm trying to get the input from the user. I'm trying the following:
<code.
<pre>
char strBuffer[100];
printf("Please enter a string to send to the server:\n");
cin >> strBuffer;
</pre>
But when debugging I saw that at every space the word gets chopped off. For example: If I entered "Hallo There"
<code>strBuffer would be Hallo
.. second loop cycle ..
strBuffer then it would be There
Please help ...
Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
This works ....
string test;
getline(cin,test);
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: printf("Please enter a string to send to the server:\n");
cin >> strBuffer;
Why aren't you using cout instead of printf() ? Yeah, printf() works just fine, but it seems silly to mix C and C++ in this fashion.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Why aren't you using cout instead of printf()? Yeah, printf() works just fine, but it seems silly to mix C and C++ in this fashion
I agree: definitely avoid mixing, definitely avoid the bad companions cin/cout
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.
|
|
|
|
|
CPallini wrote: definitely avoid the bad companions cin/cout
Why ? Is there any particular reason ?
|
|
|
|
|
Yes & No. Mainly was a Joke, but anyway, cin is buggy [^].
(...hope to get another 1.0...)
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.
|
|
|
|
|
Only if you're still using Microsoft Visual C++ 6.0. If you are (which I still am at work) then this bug is the least of your worries. If you are using MSVC 6 you should have updated your standard library by now from here[^]!
Steve
|
|
|
|
|
I don't worry about, Microsoft C++ 6.0 is quite good.
(another 1.0!?)
Cheers
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.
|
|
|
|
|
Some advice:
Don't use char arrays like you're doing. If the string is too long you'll overflow the array and corrupt the stack. Debugging stack corruptions is hard. Instead use std::string s. e.g.
#include "StdAfx.h"
#include <string>
#include <iostream>
int main()
{
using namespace std;
string s;
cout << "Please enter your name: ";
cin >> s;
cout << "Hello " << s << "!" << endl;
return 0;
}
If you must use raw char s the use the setw manipulator. i.e.
#include "StdAfx.h"
#include <iostream>
#include <iomanip>
int main()
{
using namespace std;
char s[4];
cout << "Please enter your name: ";
cin >> setw(sizeof(s)) >> s;
cout << "Hello " << s << "!" << endl;
return 0;
}
Steve
|
|
|
|
|
|
The below given function displays nothing. Why...?
How could I correct the problem..?
void CImageProcessorView::OnDraw(CDC *theDC)
{
CBitmap Bitmap;
Bitmap.CreateBitmap(100,100,1,24,NULL);
BITMAP bm;
Bitmap.GetObject(sizeof(BITMAP),&bm);
BYTE * pData=(BYTE *)new BYTE[bm.bmHeight *bm.bmWidthBytes ]; // the 24 bit bitmap buffer
for (int y=0;y < bm.bmHeight;y++){
for(int x=0;x < bm.bmWidth;x++){
pData[x*3+0+y*bm.bmWidthBytes]=0;
pData[x*3+1+y*bm.bmWidthBytes]=0;
pData[x*3+2+y*bm.bmWidthBytes]=255; // fill red in buffer
}
}
Bitmap.SetBitmapBits(bm.bmHeight *bm.bmWidthBytes ,pData);
CDC MemDC;
MemDC.CreateCompatibleDC(theDC);
CBitmap *pOldBitmap=MemDC.SelectObject(&Bitmap);
theDC->BitBlt(0,0,bm.bmWidth,bm.bmHeight,&MemDC,0,0,SRCCOPY);
MemDC.SelectObject(pOldBitmap);
delete [] pData;
}
Rajesh Rajan Pankapattu
|
|
|
|
|
Hello,
Your bitmaps are incompatible. Just try
Bitmap.CreateCompatibleBitmap(theDC, 100, 100);
instead of
Bitmap.CreateBitmap(100,100,1,24,NULL);
Regards,
|
|
|
|
|
Hi,
i want to use 24bit icons for main application icon. when i try to add these icons in VS.Net editor it by importing it. it imports correctly. now i try to add new image types from image menu but there is no option for more than 256 colors.
can some body help me how can i add other type of 24bit images like 32*32, 64*64.
early help will be very appreciating.
omar lodhi
|
|
|
|
|
|
What VS version are you using? VS2003 .NET has "Monochrome, 16, 256, True Color" options.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
I have more of a design type of question.
Can anyone tell me if it is possible to :
I have a win 32 dll and a C# web service. Instead of creating a c# client, i would like to use my win 32 dll as the client. I use this dll for other things that are all file related. Is it possible for me to make the dll the client and to be able to call the c# web service and send and receive data from it? If so, does anyone have any examples of how to turn an already existing win 32 dll into a client accessing a c# web service?
|
|
|
|