|
Hi,
PLEASE help!!! I am almost finished with this card game that I'm making, but after I had made a minor change I got a weird error that I can't make go away:
CVTRES : fatal error CVT1103: cannot read file
.\Debug\Pyramids.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
Error executing link.exe.
What can I do? Thank you SO much for your help,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
This may sound weird but on occasion, I have gotten the exact same erorr messages. Try rebuilding the entire project and see if it goes away. It usually works for me!
|
|
|
|
|
|
Whew... the rebuild all did it!
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
How do I enable controls when doing OLE embedding? I am trying to call MSWord and MSExcel and several of the buttons on the toolbars are grayed out. And I can only get one layout, the "print layout", I would like to select Normal under View menu option but it is grayed out as well. I didn't disable these controls, how did they get disabled? How can I enable them?;)
|
|
|
|
|
I have made a function to replace every occurence of a substring in a string with a new string. But if i put it in another function, then when that other function is done, an unhandled exception error appears. It's not my function performing an unhandled exception, it's the other function that does it when it's done, but only if i use the stringreplace function in that function:
Unhandled exception in app.exe: 0xC0000005: Access Violation.
here's the function:
void ReplaceString(char *target, const char *toreplace, const char *replacewith)
{
if ((!strcmp(target, "")) || (!strcmp(toreplace, "")) || (!strcmp(replacewith, "")))
return;
char *pos = strstr(target, toreplace);
int currentpos = pos-target;
char *after = new char[strlen(target)-1];
while (pos)
{
currentpos = pos-target;
strcpy(after, pos+strlen(toreplace));
strcpy(&target[currentpos], replacewith);
strcat(target, after);
pos = strstr(&target[currentpos+strlen(replacewith)], toreplace);
}
delete after;
}
Thanks in advance.
|
|
|
|
|
Check with the delete stuff if ure deleting the same area twice and make sure ure not passing somewhere out of bounds
Papa
Murex Co.
|
|
|
|
|
Always use the matching operator delete function
Check the line "delete after;". Anything strikes you as odd? Maybe if you look at how it's allocated? It should be delete[] after;
|
|
|
|
|
1. delete [] after (already mentioned)
2. after is too short. The -1 doesn't allow for the 0.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
when i write delete[] after, it does the same. and after should be one char smaller than target cause it is only supposed to hold the chars after the char to be found, fx
target = "ckndsfkndfksndf"
find = "c"
after = "kndsfkndfksndf"
|
|
|
|
|
But strcpy needs the 0 at the end of the string.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
As others have said, use delete[].
Also (unless I'm half asleep), you are not allocating enough space for the string (you are using strcpy which will copy the ending NULL). You need to allocate strlen(target), not strlen(target)-1.
|
|
|
|
|
See, Matt agrees with me.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
My scrollbars are gone. I am trying to do some embedding/automating with Word. When I do the _Application app and app.SetDisplayScrollBars(TRUE), they only appear for a couple of seconds, then the OnDraw function is performed and they are gone. What did I do wrong? It looks like when windows is sizing my document, it is losing the scrollbars. What is happening? How can I fix it? PLEASE HELP!!!!!
|
|
|
|
|
I have a system that runs multiple services on multiple servers. I have a program that will shutdown and restart a server.
I need to know how I can run this program on each server programmatically from one of the servers? AKA: Remote Process
|
|
|
|
|
DCOM
Win9x will not allow you to launch an on it from a remote machine though.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
For example if i have this string: "%A - %T.mp3" is there then any way of replacing the %A with a specified string and %T with another string? The user can enter what ever he likes, for example "%TN-%A - %T-%A.mp3".
Thanks in advance.
|
|
|
|
|
|
look at std::string or any of the dozens of non-MFC CString replacements on this site.
-c
Cheap Oil. It's worth it!
|
|
|
|
|
I know how to find the location of the system tray itself (thanks to Chris' article on the subject), but how can I find the location of a specific icon? Microsoft can do it, but I can't find any information on how to do it myself.
____________________
David Wulff
Jason Jystad wrote:
You sir, are a nut.
Jason Jystad also wrote:
You, sir, are very nearly the most terrifying individual I have ever had the honour of meeting.
|
|
|
|
|
I am trying to call VB COM Dll from ATL C++ Dll. I am importing VB dll into my C++ project but when I am trying to use VB interfaces, C++ does not seem to be able to recognize them. Does anybody know how to do this?
Michael
|
|
|
|
|
The easist way is to use the #import statement for the VB ocx in your cpp file. THsi will create a set of wrappers for the dll that you can use to access all of the functions. The wrappers also make the syntax that is used in VB available which simplifies the use of COM.
What I mean is that you will be able to call this:
long count = pList->count;
Instead of this:
HRESULT hr = pList->get_count(&count);
if (FAILED(hr))
{
_com_raise_error(hr);
}
the import statement will wrap that for you.
The other possiblity is to use the #inport statement in your IDL file, and the headers for the typelibrary will be generated by MIDL for you and you can use the interfaces the regular COM way if you prefer that method.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks for your help. But smth I am doing wrong. I am using VB dll.
This is my code in the cpp file:
#import "SuperStripperVB.dll"
//##ModelId=3D05003F0087
SSMessenger::SSMessenger()
{
// create instance of SuperStripperVB
_MessageWindow* pMsg;
}
The error I am getting is:
'_MessageWindow' : undeclared identifier
Even though, I have interface _MessageWindow in SuperStripperVB.tlh (tli) which are created by the #import statement.
Thanks,
Michael
|
|
|
|
|
I am currently trying to automate word into my application. I am currently capable of opening the word document but I need some answers to a couple of (possibly easy) questions:
1) Why are most of the control buttons (Open, New, Save, etc) disabled but the menu options are not disabled. I would like all the features of word that would be allowed if user opened word him/herself.
2) I am having problems with the WinWord remaining in memory. I need to ReleaseDispatch, but where? From OnDestroy, because the doc and app are localized in another functions, should I make these global to do this?
3) The view of the document is really bad. When the document comes up, it is smaller than the window. Also, the only view I have is teh Print Layout, the Normal, Outline, and Web Page are all disabled and I don't know why.
Please Help, I have been stuck for a while!!!!!!!
|
|
|
|
|
I am having a problem with scrollbars. I am currently using automating MS Word into an application. It brings up MS Word but the scroll bars are there for about 1 to 2 seconds, then they disappear. What could be causing this? I looked through the documentation and found a lot about changing to CScrollView and it worked as far as keeping the scrollbars on the screen. But if I resize the document in the window (not resize the window itself), I lose the scroll bars. What could be my problem?
|
|
|
|