|
Buy a book on C++, or use Google to find some of the thousands of samples that are available.
Veni, vidi, abiit domum
|
|
|
|
|
Identify your primary objective. If it is producing a new application, then stick to the language you know best, but if it is learning C++ then follow Richard's advice.
I faced the same choice some years back, and since my primary objective was learning C++ I went down this route. Had it been the production of a new application I would have continued with COBOL.
I never had any desire to branch out into C# but it made practical sense to adopt it for the WCF and ASP.NET aspects so that got learned too. Nowadays Visual Studio, and particularly the express versions offer better UI experiences in C#, so consider that C++ may not offer all you desire.
Ger
Ger
|
|
|
|
|
Hi,
I am using Sumatra in my Visual Basic 6.0 like this
Dim cmdline as string
Dim ret as integer
Dim hwnd As Long
Dim gstrPathAndFilename as string
gstrPathAndFilename="C:\test.pdf"
hwnd = Picture1.hwnd
cmdline = "C:\Program Files\SumatraPDF\SumatraPDF.exe -plugin " & hwnd & " " & gstrPathAndFilename
ret = Shell(cmdline)
The above code works perfectly in VB6.
Now I am trying to convert the above code to Visual C/C++ 6.0 like this
static HWND hwndPicture ;
hwndPicture = GetDlgItem (hwnd, IDC_PIC) ;
ShellExecute(
hwndPicture,
TEXT("open"),
TEXT("C:\\Program Files\\SumatraPDF\\SumatraPDF.exe"),
"d:\\Test\\test.pdf",
TEXT(" d:\\ "),
SW_SHOWNORMAL);
It works but not inside the form and picture box, it opens a new window.
Can someone help me, I new in Visual C++
Thanks,
Russell
|
|
|
|
|
Well, for one thing, you're failing to pass the "-plugin" parameter on the command line in the C++ version.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Well, there are several functions which converts MBCS to WCHAR.
Among them, I often used A2W and MultiByteToWideChar. But I don't know the difference and which is the best.
Often, A2W is very simple to use but when I use it in the scope of while or thread, It often occurred stack over flow errors.
What's wrong?
Could anybody notice me which function is the best and which A2W occure Stack Over flow error?
Thank you.
|
|
|
|
|
|
|
Dear Experts
I am designing a c++\mfc program. I have a problem by the resolution of the icons in the designing procedure. When I open a designed icon, visual studio open it as 256 color image, however the original image has a higher resolution. Also, when I create a new icon visual studio sets its resolution as 16 colors.
How I can open the icon as original resolution or increase the resolution of an icon?
Please guide me to solve the problem.
Bests
|
|
|
|
|
|
That's not problem.
When you using your icon resource from source, there is not resolution problem occurred.
You can load your icon resource from files with LoadIcon function. You can see details from MSDN. That's all.
|
|
|
|
|
After a long time guys, I am back to C++, however this time working as a tester.
I actually want some kind of tool for static analysis of the code, like checkstyle in JAVA. And I need that for Linux Platform and should be free.
What i mean by static analysis is, it tell you the coding style error, unused variable and function names
Gaurnag shah
modified 20-Nov-13 10:41am.
|
|
|
|
|
I have personally used two C++ static code analysis tools.
1. Visual Studio. I believe all SKUs of VS 2013 now include code analysis tools though the level of analysis in the Free express edition is not as nice as in the paid versions. Menu is: ANALYZE > Run Code Analysis on Solution.
2. Klocwork. We pay for a Klocwork license [^]. I'm not sure if they have a trial or free version available. A caveat: Klocwork does not handle C++/CLI code however so it skips the /clr files. We have a large body of portable plain C++ code so it works well with that code.
I'm sure there are other tools but C++ code analysis is difficult and most are expensive commercial tools.
John
|
|
|
|
|
http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis[^]
Most of the tools are commercial, but if it is your job, and you find that one of the commercial tools will notably improve the quality or speed of your work, you shouldn't have any problems convincing your boss to buy a license. The free ones I've tried are rather limited in scope and capabilities.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
When I read about delegate , I can figure out what that is and when we use that. But when I read about event , I mix things up and cannot find out how to understand the real difference and exact use of that in my codes. Every time I read about event , it gets more blur in my mind! Can you please explain that in a simple way? Thanks
|
|
|
|
|
A delegate is like a function pointer, and event is like a function.
When an event is raised, it calls each delegate that is attached to it.
Events are generic in that they can accept delegates that point to any function, as long as the delegates ' signatures match the signature of the event .
Events are points of attachment for delegates to receive calls from an object.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I know a little in C++ world by reading some basic parts of C++ Primer book and doing simple stuff by C++. I'm about in the middle of the Microsoft Visual C++/CLI Step by Step and trying to reach a middle level in C++, the language I love. I like to write Windows apps including the traditional way and also Windows store. Do you have any advice or recommendation to me as an improvement, getting much better or so? Thanks guys
|
|
|
|
|
|
As Richard indicates, nothing beats actually writing some code and learning by doing.
There is one book I really like which isn't on the reference page:
"C++/CLI In Action" by Nishant Sivakumar.
|
|
|
|
|
Hi all,
I want to use MD5 to hash message. I see some implementation in the internet but my problem is that my message is not a string but a packet type. Someone can help please?
regards
|
|
|
|
|
Hashing works on bytes, whether they are characters or not is not important.
Veni, vidi, abiit domum
|
|
|
|
|
Well, type of data is not important.
Anyhow you have to send data to MD5 with array so there is no important thing happened when you send char array or byte array.
The difference between your message and string is that use byte array or use char array.
So, you can send byte array which implements your message contents to HD5 instead of char array. That's all.
|
|
|
|
|
#include <stdio.h>
#include<string.h>
char f[10000];
char factorial[1010][10000];
void multiply(int k)
{
int cin,sum,i;
int len = strlen(f);
cin=0;
i=0;
while(i<len)
{
sum=cin+(f[i] - '0') * k;
f[i] = (sum % 10) + '0';
i++;
cin = sum/10;
}
while(cin>0)
{
f[i++] = (cin%10) + '0';
cin/=10;
}
f[i]='\0';
for(int j=0;j<i;j++)
factorial[k][j]=f[j];
factorial[k][i]='\0';
}
void fac()
{
int k;
strcpy(f,"1");
for(k=2;k<=1000;k++)
multiply(k);
}
void print(int n)
{
int i;
int len = strlen(factorial[n]);
printf("%d!\n",n);
for(i=len-1;i>=0;i--)
printf("%c",factorial[n][i]);
printf("\n");
}
int main()
{
int n;
factorial[0][0]='1';
factorial[1][0]='1';
fac();
while(scanf("%d",&n)==1){
print(1);
}
return 0;
}
|
|
|
|
|
And??
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
??
What do you want?
|
|
|
|
|
Beside the fact that no question is asked, there is no CLI in the code; this is all standard C++. I believe this is posted to the wrong forum.
|
|
|
|