|
Are you referring to either the /base or /fixed linker option?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
First, I use Visual Studio.
Invalid after adding add "/fixed" linker option.
and
error LNK1146: no argument specified with option '/base'
|
|
|
|
|
The question is stupid, there is no way a dynamic heap manager can guarantee it wont give the memory space away to some other call for memory allocation. To do what you asked it would have to keep the memory "available" anyhow, so for the love of all things coding just declare the thing static in that case (unless you actually want a global).
My C++ is rusty with string objects but it should be something like
static char* str = char[128];
In C it is simpler
static char str[128];
Problem solved it now has the same address everytime locally, and effectively does the same thing that any crazy heap manager doing what you asked would have to do.
I am assuming you are going to change the string at times, so you want a variable not a constant.
In vino veritas
modified 13-Nov-19 8:47am.
|
|
|
|
|
The first form is not valid C++. And the second form still does not work since the compiler and the linker can allocate that array in different places.
As you so rightly say, the question is stupid.
|
|
|
|
|
Main Question: Is it possible to set a tree item image (CTreeCtrl::SetItemImage) without having to build a CImageList ?
I have to build different images corresponding to the items state and I would like to be able to create the image dynamically (lot of TransparentBlt) instead of having to list and build all the images and add them statically to the image list.
i have a default item image and I TransparentBlt state images on it
for example, an item can have the state1 enabled, and will display the appropriate image representing state1.
an another item can have state1 and state4 and will display an image with the state1 and state4
Now, I have to create the imagelist for all combinations of states at compile time and call the SetItemImage with the image list index.
I'd like to be able to simply call something like:
myTree.SetItemImage( hItem, BuildMyItemImage(hItem ) );
I'd rather be phishing!
|
|
|
|
|
|
that's what I am doing; just annoying to have to create images for many combinations.
Thanks.
I'd rather be phishing!
|
|
|
|
|
Hello everyone,
I wrote an MFC app some years ago that connects to an FTP server. Recently the server has switched over to FTPS so whenever I try to connect I get the following message:
550 SSL/TLS required on the control channel
I'm using the following code to connect to the server:
CInternetSession* pSession = new CInternetSession(L"myApp", 1, 0, 0, 0, INTERNET_FLAG_DONT_CACHE);
CFtpConnection* pFtpCon = pSession->GetFtpConnection(L"*IPAddress*", L"*Username*", L"*password*", 21);
I was wondering if it is possible to connect to an FTPS server using CInternetSession/CFtpConnection and if so how. Or will I need to use a library to achieve this. I've searched around on the internet but can't find a definitive answer.
Any help would be most appreciated. Thanks.
|
|
|
|
|
Are you able to connect to this new server manually?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi David,
I can access the server using FileZilla with no problems. I know very little about FTP/FTPS but my guess is that CInternetSession/CFTPConnection do not support SSL(TSL); I've been doing quite a lot of reading but haven't found anything to confirm this however. I think my next step is to try out curl.
Thanks.
|
|
|
|
|
Did you read what was said here, and the suggestions?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I hadn't seen that particular post, but I've seen most of the links listed there. I did try adding ftps:// to the server name, as suggested in that link, but that returns and invalid url error. I was hoping for a simple solution but it looks to be more complicated than I hoped.
Thanks for the help!
|
|
|
|
|
I wanted to add .ico and .bmp files in the bottom of the dialog right after static text (e.g.like this-> warning and help )respectively.
I'm having difficulty achieving this. I would like to request some guidance with this.
Thanks in advance.
|
|
|
|
|
Member 14575556 wrote:
I'm having difficulty achieving this. Which part exactly? Adding an image control to a dialog resource? Reading an image into a CImage or CBitmap object? Rendering that object?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yes adding icon in any place in the dialog. I wanted to put my custom icon in the left bottom corner of the dialog box.
Any guidance will be very helpful thanks.
|
|
|
|
|
Can you not just add the control to the dialog resource like you did all of the other controls?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Thank you for the reply. I did that and achieved what I wanted. 
|
|
|
|
|
It's called the NON client area but sorry I don't use MFC enough to help.
What I can tell you is on the windows API it's the WM_NCPAINT message you need to handle
and you simply draw the image onto the Device Context it provides.
The WM_NCPAINT message is sent to a window when its frame must be painted.
The DC is funny it is the size of the whole frame window with a big hole in the middle you cant draw which is the normal
client area. So you can draw from RECT.bottom up whatever the height of the frame is.
WM_NCPAINT message - Windows applications | Microsoft Docs[^]
You need to handle that however you do in MFC (the code snippett on the link shows how you get the DC on normal Win32 API).
In vino veritas
|
|
|
|
|
I have already recommended that course to him more than once. And also explained why MFC is not the best vehicle when you want to change almost everything about the look of the GUI objects.
|
|
|
|
|
leon de boer wrote: It's called the NON client area but sorry I don't use MFC enough to help.
Why is "the left bottom corner of the dialog box" called "NON client area"? 
|
|
|
|
|
Thought he wanted to draw in the frame which is non client .. that belongs to windows (the O/S) not the app (the client).
It's so easy to draw in the normal client screen area with MFC didn't think you could mess that up ... Anyhow he worked it out.
Moral never over-estimate the question being asked
In vino veritas
|
|
|
|
|
You just need to add the relevant resource to your dialog. Either by adding a manual resource statement like:
ICON IDI_APPLICATION, IDC_STATIC, 7, 7, 20, 20
, or via the Visual Studio resource editor.
Perhaps if you explain clearly what the problem is we may be able to offer further suggestions.
|
|
|
|
|
Thank you for the reply. After a lot of trial and error and following the guidance. I got what I wanted. 
|
|
|
|
|
I need to save space and reduce some of my function pointers from 32-bit to 16-bit and this is ok since the flash region I've specified in the linker script is only 32 kBytes. Does anybody know how I can make my 3rd example below compile properly?
typedef struct {
uint16_t myFunctPtrTruncated;
} myUint16struct_s;
typedef struct {
void* myFunctPtr;
} myVoidstruct_s;
static void myDummyFunc() {}
myVoidstruct_s myStruct1 = { myDummyFunc }; myUint16struct_s myStruct2 = { 0 }; myUint16struct_s myStruct3 = { (uint16_t)(uint32_t)myDummyFunc };
|
|
|
|
|
I just tried this with Microsoft's Visual C++ compiler and it compiles cleanly.
|
|
|
|