|
I created a CDialog application. To support multilingual version. I created some different language dlls which only contain the resource. But I don't know how to change the dll when the application is running.
|
|
|
|
|
|
I know how to load res-only-dll in MDI app. But in CDialog app, it seems a little different. I can't change the dll on the fly.
|
|
|
|
|
the function is WinMain()
the parameter is "-a 123 -b 456 -c 789"
How to get "a", "3" ,"456" ,"7";
thank you very much.
|
|
|
|
|
Use GetCommandLine() to get the EXE's command line. If you're using the MS CRT, you can also use __argc and __argv which work like argc and argv do in console-mode apps.
|
|
|
|
|
the program is win32 program,not console program.
the MSDN says there must be 4 parameters.So, I can't use __argc and __argv.
Can you give me some codes to resolve the problem?
thank you very much.
|
|
|
|
|
as Mr Dunn had said you can use GetCommandLine to reterive the CommandLine argument! why don't you use that... also __argc and __argv are available if you are using MFC !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
I am a beginner.
Now the parameter of the winmain is "-a 123 -b 456 -c 789",I want to analyse the parameter.
in main(int argc char **argv),I know argv[1] is "-a",argv[3][0] is "-" ,and argv[5][1] is "c".
But from the MSDN ,I find the return value of the GetCommandLine() is "The return value is a pointer to the command-line string for the current process".
How to achieve the target just as main(int argc char **argv).
thank you
|
|
|
|
|
abruzzi wrote:
the program is win32 program,not console program.
So.
abruzzi wrote: the MSDN says there must be 4 parameters.So, I can't use __argc and __argv.
You have access to __argc and __argv regardless.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
__argc and __argv aren't parameters to a function. They are set up by the CRT, and you can access them any time.
|
|
|
|
|
I have a project built using VC2005.It uses some lib files.But if the lib files was built using VC2005,it works well.But if there has some lib files which was built using VC6.The VS would show me some error that can't open the lib file.
But I indeed using some lib file I don't have its codes,how should i resolve such problems?(using VC6 lib files in VC2005)
Thanks.
|
|
|
|
|
make sure in your project file it know how to find that lib file, are you doing this?
1. project -> properties -> linker -> general
in the general section: make sure to point to the lib file in, "additional library directory" files
2. then under the "input" section of the linker, "additional dependencies" put in the name of you lib file you will be linking to, if more than one, separate them with a space.
Yours Truly, The One and Only!
|
|
|
|
|
Hi all, i found out that my char array wont work with a string so i was recommended to std::vector. I've never used it before and im looking for information on how to use it, closest i've gotten to a explanation is this http://www.roguewave.com/support/docs/sourcepro/edition9/html/stdlibref/vector.html]
but i dont understand the concept. Im bascially trying to use an array of strings with the aide of this vector. If anyone would like to explain a bit or have a better site to go to i'd appreciate it. Thanx in advance!
Here's the offending code.
<br />
char* randomlist[]={<br />
"Test", "Huh"<br />
};<br />
#define SIZEOFAR 2<br />
<br />
bool randomchar(){<br />
string _random = random;<br />
srand((unsigned)time(NULL));<br />
BUF = "SEND " + _random[rand()%SIZEOFAR] + "\n";<br />
SendToServer(BUF.c_str());<br />
return true;<br />
}<br />
<br />
|
|
|
|
|
Looks like you're trying to use std::string, and not vector.
>> string _random = random;
The above should look something like the following:
string _random = random[0];
It should be pointing to a string within your array of strings.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
You have not entered all the code correctly:
- The "<" and ">" characters are missing as is everything between them!
- What is BUF ?
Steve
|
|
|
|
|
dellthinker wrote: ...i found out that my char array wont work with a string...
Which means what exactly?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello, I'm new to MFC, and there's an application in a book I'm learning from which works 100% well, but there's something there I don't manage to understand.
The author there built a Sketcher application, which draws lines or rectangles or such by dragging with the mouse. The OnMouseMove function redraws a temp object every time, with the R2_NOTXORPEN set, so it's supposed to erase the temporary element drawn, and create a rubber-banding mechanism. Now, my question is, if I drag a temporary element over the background, and over other elements drawn in the background, how is it the temporary object doesn't erase them, after it's drawn again? According to the book, the R2_NOTXORPEN mode makes it so the element is redrawn white, so it should delete everything it goes over.
The book is Beginning MFC Programming by Ivor Horton.
Thanks for your help, and sorry for the length, I tried to keep it as short as possible.
|
|
|
|
|
Perrin01 wrote: the R2_NOTXORPEN mode makes it so the element is redrawn white
Not necessarily. The resulting color depends on the color of your pen and the color of the
screen pixel it's being combined with.
Here's how they get combined (from the docs):
R2_XORPEN Pixel is a combination of the colors in the pen and in the screen, but not in both.
R2_NOTXORPEN Pixel is the inverse of the R2_XORPEN color.
These are bitwise logical XOR and NOT combinations that are applied to the RGB components of the
pixel colors (the docs don't exacly state that ).
For each red, green, and blue pixel byte, when combining colors, if you use a pen color RGB
(0xFF,0xFF,0xFF) with R2_NOTXORPEN:
Every bit gets flipped (XOR)
Every bit gets flipped again (NOT)
Result is the original pixel so you don't see any change
If you use a pen color RGB(0x00,0x00,0x00) with R2_NOTXORPEN:
No bits get flipped (XOR)
Every bit gets flipped (NOT)
Result is binary inverse of the original pixel
Hope that helps a little.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Yes, but in this case the pen is the same color as the screen color, so the element should turn to white (ie get erased). And it should erase (turn to white) everything it passes over, no?
It's very confusing... :/
|
|
|
|
|
Ok I see what you're talking about
Look closely at the code - it's probably redrawing twice (once at the old position, and again at
the new position) whenever the cursor moves.
The first drawing would make a pixel white.
The second would restore it to its original color.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
How would the second turn it to its original color, if it's done at a different location?
As I see it, it's 2 draws, one that blanks the last temporary element, and a second that draws the new temporary element.
Here is the code:
CClientDC aDC(this);<br />
aDC.SetROP2(R2_NOTXORPEN);
if((nFlags & MK_LBUTTON) && (this == GetCapture()))<br />
{<br />
m_SecondPoint = point;
if(m_pTempElement)<br />
{<br />
m_pTempElement->Draw(&aDC);<br />
}<br />
<br />
m_pTempElement = CreateElement();
m_pTempElement->Draw(&aDC);
}
Thanks!
|
|
|
|
|
Perrin01 wrote: // Redraw the old element so it disappears from the view
m_pTempElement->Draw(&aDC);
That's what prevents it from leaving drawing artifacts as the cursor is moved.
R2_NOTXORPEN is non-destructive to the destination pixel when done twice over the same pixel.
Comment out the line of code there (at the "// Redraw the old element so it disappears from the
view" comment) and see what happens
Mark
-- modified at 20:17 Sunday 15th July, 2007
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Ohh, thanks, I finally understand it!
Thank you very much.
|
|
|
|
|
Hi everybody,
we have a 2-tier (unmanaged) C++ application (being compiled with VS 2005) that is connected to MS-SQL and allows the user to browse and edit order records. The data access and business layer objects are well defined (so-called “core”) and the UI layer uses them and the MFC to provide a rich user interface.
Now we want to “web enable” this application, which means that the user shall be able use the application via a web browser (IE and Firefox).
Which “technology horses” could and which should we ride?
a) enabling the core to become a “server” (IIE extension?, C++.NET and web services?, creating own server with native C++ SOAP? ...?)
b) bringing a rich UI to a web browser including performant data exchange with the server (ASP.NET with Web Forms? AJAX based Javascript UI library? ...?)
On what topics should we start reading to create a base for deciding?
I'd appreciate your input very much!
Mike.
PS: If I could expect more specific answers in another newsgroup/forum then I'd appreciate a quick hint or a FUP as well.
|
|
|
|
|
You may also want to post this on the Web Development Board[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|