|
hello guys... I made a small application in VC2010 in Windows 7. Long story short, when I first tried to use it on Windows XP, it gave me an error saying it could not find a component (I don't remember which one). I searched for that and after couple of hours I assumed that I should install .Net Framework 4.0, and VC 2010 Redistributeable Package. I did that but now it gives me this error
Mfc100d.dll Not Found
Now installed a program which, it claimed, installed Mfc100d.dll. But still problem remains. What could be wrong? Thnx
This world is going to explode due to international politics, SOON.
|
|
|
|
|
Mfc100d.dll is the debug version of the MFC library and is not distributed by default. Rebuild your project in release mode to run on alternate machines.
|
|
|
|
|
I go with what Richard MacCutchan told. Debug binaries are not distributable. But to run the application in debug mode, you can copy Mfc100d.dll to the location where your exe and other dependent binaries resides. This will solve the problem.
When somebody is looking for a dll and complains it is not there, then dll is not available the in the application's working directory, or the directories listed in the environment variable.
http://www.mstecharticles.com/
|
|
|
|
|
sirama2004 wrote: http://www.mstecharticles.com/
Hi Buddy,
I went to your site, look full of information, however if you reduce the advertisement content it would look nice, otherwise it's look more of advertisement site then technical article site
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thanks Alok. I spend 50% of my 1 month salary on CRY at the year end. I am happy to see Supprt Cry in your Signature
|
|
|
|
|
In addition to what Richard said (build in release mode), you have a few alternatives for distributing MFC with your application (if there's a dependency there):
0. Use MFC as a DLL and distribute using Microsoft's redistributable package installer[^].
1. Built in the MFC as a static library (will make your build larger but you'll only have to distribute your exe).
2. Distribute the DLL yourself using an installer such as InstallShield (or something similar).
3. If you don't use MFC at all in your project, disable the dependency.
|
|
|
|
|
This is why I don't like the Microsoft(R) .NET Framework, users have to download an add-on to run just ONE program, then it gives them errors ....even though it's easier on the programmer's side when the purpose of that framework was to make programming easier, on the customer's side it only gives complaints, that the software is not neat and tidy.
Simple Thanks and Regards,
Brandon T. H.
Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst).
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
modified 22-Jun-12 3:48am.
|
|
|
|
|
I did C structs a few years ago at uni.
I am trying to avoid malloc for all structures in the tree- since I would need to be sure it has all been freed.
In the first two ways without malloc but both end up using local stack variables which ‘disappear’ and are not kept in memory.
But Only the malloc response has the correct answers after the function call.
#include <stdlib.h>
#include <stdio.h>
struct thing1
{
int n;
char* word;
};
struct thing2
{
int n;
char* word;
struct thing1 *node1;
};
struct response
{
int n;
struct thing2 *node2;
};
int getDynamicResponse(struct response* res);
int getResponse(struct response* res);
int getRefResponse(struct response* res);
struct thing1 getThing1();
struct thing2 getThing2();
void refThing1(struct thing1* out);
void refThing2(struct thing2* out);
void showThing1(struct thing1 *t1);
void showThing2(struct thing2 *t2);
void showResponse(struct response *res);
struct thing1 getThing1()
{
struct thing1 t1;
t1.n = 1;
t1.word = "thing1";
return t1;
}
struct thing2 getThing2()
{
struct thing2 t2;
t2.n = 2;
t2.word = "thing2";
return t2;
}
void refThing1(struct thing1* out)
{
struct thing1 t1;
t1.n = 3;
t1.word = "refthing3";
*out = t1;
}
void refThing2(struct thing2* out)
{
struct thing2 t2;
t2.n = 4;
t2.word = "refthing4";
*out = t2;
}
void showThing1(struct thing1 *t1)
{
printf("thing1\n");
if(t1)
{
int i = t1->n;
if(i) printf("n=%d\n", i);
if(t1->word) printf("word=%s\n", t1->word);
}
else printf("Thing1 NULL");
}
void showThing2(struct thing2 *t2)
{
printf("thing2\n");
if(t2)
{
printf("n=%d\n", t2->n);
if(t2->word) printf("word=%s\n", t2->word);
if(t2->node1) showThing1(t2->node1);
}
else printf("Thing2 NULL");
}
void showResponse(struct response *res)
{
if(res)
{
printf("response\n");
printf("n=%d\n", res->n);
if(res->node2) showThing2(res->node2);
}
else printf("Response NULL");
}
int getDynamicResponse(struct response* res)
{
printf("\nwith malloc\n");
printf("n=%d\n", res->n);
struct response *tmp;
tmp = (struct response*)malloc(sizeof(struct response));
tmp->n = 12345;
tmp->node2 = (struct thing2*)malloc(sizeof(struct thing2));
tmp->node2->n = 2468;
tmp->node2->word = "malloc1";
tmp->node2->node1 = (struct thing1*)malloc(sizeof(struct thing1));
tmp->node2->node1->n = 987;
tmp->node2->node1->word = "malloc2";
*res = *tmp;
showResponse(res);
printf("***************************\n");
return 0;
}
int getRefResponse(struct response* res)
{
printf("\nby pointer ref\n");
printf("n=%d\n", res->n);
struct response out, *pout;
res->n = 888;
struct thing2 t2;
struct thing1 t1;
refThing2(&t2);
refThing1(&t1);
struct thing1 *p1 = &t1;
struct thing2 *p2 = &t2;
pout = &out;
pout->node2 = p2;
pout->node2->node1 = p1;
*res = out;
showResponse(res);
printf("***************************\n");
return 0;
}
int getResponse(struct response* res)
{
printf("\nlocal stack\n");
printf("n=%d\n", res->n);
struct response out, *pout;
res->n = 99;
struct thing2 tmp2 = getThing2();
struct thing1 tmp1 = getThing1();
struct thing1 *p1 = &tmp1;
struct thing2 *p2 = &tmp2;
pout = &out;
pout->node2 = p2;
pout->node2->node1 = p1;
*res = out;
showResponse(res);
printf("***************************\n");
return 0;
}
int main(int argc, char **argv)
{
printf("structs\n");
struct response r1, r2, r3;
r1.n = 51;
r2.n = 52;
r3.n = 53;
getResponse(&r1);
printf("=====================\n");
getRefResponse(&r2);
showResponse(&r2);
printf("=====================\n");
getDynamicResponse(&r3);
showResponse(&r3);
printf("=====================\n");
getchar();
return 0;
}
|
|
|
|
|
unless you know your tree will never exceed a certain number of nodes, you will most certainly have to use some kind of dynamic memory allocation (ex. malloc).
but...
in getResponse:
struct thing2 tmp2 = getThing2();
struct thing1 tmp1 = getThing1();
struct thing1 *p1 = &tmp1;
struct thing2 *p2 = &tmp2;
tmp1 and tmp2 are going to go out of scope when the function exits, so p1 and p2 are going to be pointing at garbage.
the malloc version works because those dynamically allocated structs still exist after the function exits.
|
|
|
|
|
So declare the struct instances globally.
|
|
|
|
|
Doing it by reference should work as well, but you're doing it wrong... think about what you did wrong in that instance (i.e. you're passing a pointer of an existing object to the call, it should not be loading an instance of a local variable).
|
|
|
|
|
Bacchus Beale wrote: since I would need to be sure it has all been freed.
So create the following functionality.
1. Measure the tree needed.
2. Alloc that size - one single alloc.
3. Create the structs, including pointers within that single allocated block.
When you are done with the tree then there is only one allocation to delete.
Your functions would look something like the following. Correct pointer arithematic provides pointer values.
int SizeOfThing2();
void SetupThing2(struct thing2* dst, char* word, struct thing1* s1);
|
|
|
|
|
Hi Folks,
I am trying to add a Video Player to a Form in
C++ Builder 5, Using the Object Inspector I change the Name field then I go to the FileName field to point to the AVI file I get a "Cannot Open AVI" error consistantly. I have serveral different AVI files which all work with the Windows Media player. BTW I am working on a Windows 7 machine. Any ideas please?
|
|
|
|
|
Just out of curiosity - can you post your code for openning the file?
|
|
|
|
|
I have a dialog based app I am writing. In this app I am going to have to present different information to the user and in some cases ask for some input in various orders depending on a given situation. I figured property pages would be a great solution since I could design a bunch of panels and then show them in whatever order I want, as needed.
The fundamental problem is that in a given area I just want to show just the panel I made. In one mode I get "tabs" like a tab control. In another mode (Wizard Mode), I get a bunch of buttons at the bottom.
If I could hide the tabs OR hide all the buttons in wizard mode, it would work. I also have a bitmap logo on top, and I thought if I could get the bitmap to draw itself after the property sheet, I could hide the tabs underneath it, that might work. I do not know how to make the property sheet object draw itself before the bitmap logo at the top.
So is there a way to do this or just render my panels with no extras at all inside my dialog box?
|
|
|
|
|
|
Thanks for that, Ill look into it. I was pursuing something similar on my own, giving up on Property Sheets / pages altogether. It was just overlaying modless dialog boxes inside the main one.
|
|
|
|
|
DeepT wrote: The fundamental problem is that in a given area I just want to show just the panel I made. In one mode I get "tabs" like a tab control. In another mode (Wizard Mode), I get a bunch of buttons at the bottom. So why not make both (i.e., one dialog that is a tabbed property sheet, and another dialog that is a wizard property sheet), and only show the one that is needed (based on some condition)?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
If you just make one property page, you get one tab shown at the top. I didn't want ANY tabs to be shown. If you use wizard mode, you get the buttons. I do not want any buttons. I hope I am being clear on what I wanted to do.
|
|
|
|
|
Is there a reasonable way ( in VC6.0 & MFC 4.0!) to update CPropertyPage using UpdateAllViews?
I can manage to pass the document pointer to the page but cannot find an easy way to pass the UpdateAllViews message to the page(s).
Perhaps iterating thru all of the pages ( using MFC), posting each update in similar MFC fashion ? How?
Thanks for your help.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: Is there a reasonable way ( in VC6.0 & MFC 4.0!) to update CPropertyPage using UpdateAllViews?
Why would you want to? That's for documents and views. Why not use QuerySiblings() instead?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Because it does not exist it VC 6.0 MFC 4.0
|
|
|
|
|
Sure it does. Check line 289 of dlgprop.cpp and line 528 of afxdlgs.h .
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thanks David,
somehow my ancient MSDN could not help me find it.
And I just did not think the page itself would do it, but I guess that is why they call it "querrysiblings", duh!
So if I get to any page from the UpdateAllViews which starts the update, I should be able to figure it out. I guess I can pass the document pointer that way too, super.
It seems strange way to do page updates, bypassing the sheet and the frame, but if it works what a hey.
Thanks again for your persistence.
Vaclav
Addendum
It seems that there are some holes in my old MSDN docs and MFC and API functions for updating pages are not same.
It looks as API runs the update from the sheet and MFC from page. Either way, the PSM messages are hidden in MFC doc and the document pointer cannot be passed directly to the page using the QuerrySiblings.
-- modified 19-Jun-12 18:39pm.
|
|
|
|
|
If you need access to the document from some other place (e.g., property page), try:
AfxGetMainWnd()->GetActiveDocument();
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|