|
I'm using VC++ 6.0
Yesterday I was working on one of my class files, just adding a couple if statements and such, nothing big. After I was done, I tried compiling and I'm now getting some errors that I have no clue how to fix. This class file compiled and ran just fine before I added this additional code, so to try to isolate the problem, I commented out what I had done yesterday and tried compiling again, but I'm still getting the same errors. It almost seems as though my header file, containing all the function definitions, isn't being completely recognized. For example, one of the errors is:
C:\Program Files\Microsoft Visual Studio\MyProjects\GUPIXWIN\CreateMegaFile.cpp(603) : error C2601: 'CreateBatchModeString' : local function definitions are illegal
All the errors are exactly the same, it's just that the function name (enclosed in single brackets above) changes.
I'm getting this same error for 6 of my functions, which are all defined within the included header file: CreateMegaFile.h
This is the format of the function definitions within my header file, and clearly there's nothing wrong with these definitions!:
CString CreateSetupString();
CString CreateSampleStructureString();
CString CreateDefineMatrixString();
CString CreateDefineTraceString();
CString CreateDefineFitString();
CString CreateDefineInvisibleString();
CString CreateBatchModeString();
CString CreateSpectrumFitString();
CString CreateBackgroundEdgeString();
CString CreateDigitalFilterString();
CString RemoveElementSymbol(CString original);
CString BreakString(CString cstr, int pos);
the last 6 functions are the ones that are giving the errors. Yesterday, when I was adding code into this class file, I wasn't touching any of the code within those last 6 functions. I was adding code into the first one.
Does anybody know what's going on here?!
Thanks.
|
|
|
|
|
b_girl wrote:
For example, one of the errors is:
C:\Program Files\Microsoft Visual Studio\MyProjects\GUPIXWIN\CreateMegaFile.cpp(603) : error C2601: 'CreateBatchModeString' : local function definitions are illegal
This is indicative of an extra, missing, or misplaced curly bracket.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
DavidCrow wrote:
This is indicative of an extra, missing, or misplaced curly bracket.
*ahem* yeah... just found it. wow... i feel dumb! i thought i had checked for missing curly brackets before, but i guess i must have skipped over this one by accident. thanks.
|
|
|
|
|
hey, how can I access my document class from within my CMainFrm class. I need this because I'd like to use a SplitterWnd with various dialogs on my second view. So I need a ability to access my CDoc-class from my dialogs. I think I create a membervariable on each dialog class and assign a pointer in CMainFrm.
Is there a way to access my Doc class without need of a pointer?
|
|
|
|
|
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
CMyView *pView = (CMyView *) pChild->GetActiveView();
CDocument* pDoc = pView->GetDocument(); /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Dear MFC Gurus!
My brains don't want to work. I have no ideas. I'm writting simple MFC-based application. ShellExecute doesn't
work in my application (in other words, when clicking the static control, MSIE doesn't start):
UINT err=(UINT)::ShellExecute(NULL,_T("open"),_T(WEBSITE),_T(""),_T("c:\\"), SW_SHOWNORMAL);
This returns "SE_ERR_ACCESSDENIED". Why?
By the way, I have another project in the _same_ workspace where it works fine. Moreover, I used this scheme
always but today it doesn't work! Help! Urgent!
Yours sincerely,
Alex Bash
|
|
|
|
|
What is the value of WEBSITE at the time of this call? There is nothing wrong with the code as it works for me.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Sorry,
#define WEBSITE "http://www.microsoft.com"
The problem is still not resolved. I'm in shock. Any ideas?
Yours sincerely,
Alex Bash
|
|
|
|
|
Hi,
I'm currently do some work involving images which have been stored in RAW format. Although I can perform all the necessary computing on them one 'nice' thing that has been requested is that my program displays the initial image so that different points (areas of interest) can be selected on the image instead of the co-ordinates being read in from a file. Does anyone know how to display this type of image using VS C++ 6.0 and MFC?
Also (I think I may have solved this one already, however....) how can the window be resized to a fixed size?, e.g. 320x240. The program is SDI and derived from CView.
many thanks,
Andy
|
|
|
|
|
It depends on what you mean by RAW format?
If you have direct access to the image bits then you can create a bitmap (or DIB Section) the same size as the image and write a function to translate (copy) from one format to the other.
mcsherry wrote:
how can the window be resized to a fixed size
Answer: over-ride the OnSize() handler.
INTP
|
|
|
|
|
|
I keep getting a linker Error 2005 about functions already being defined for every class I try and make in VS.net. I program my classes by putting the class definition in one file and them the actual code for the functions in a seperate file. for example:
***myclass.h file***
class myclass
{
public:
void myfunc();
.....
***myclass.cpp***
#include "myclass.h"
void myclass::myfunc()
{
.......
This will always give me a linker error that there are two definitions for the function myfunc in the object file. I can make the error become a warning if I use the linker command /FORCE:MULTIPLE but that does not seem like the best way to overcome the problem even though the program will work fine when I do that. Does anyone have some helpfull suggestions to solving this problem. (I do not want to put the meat of the function in the class definition as sometimes the functions are rather big.)
|
|
|
|
|
I doubt that in myclass.h, the function is declared as void myfunc(){ }; // with brackets. this is considered as a definition. Maybe.
|
|
|
|
|
Im not exactly sure what you are trying to say with this are. I am not useing {} with the function in the class definition and that has been the stand that worked with every borland compiler I used in the past. I just recently started using Visual Studio.NET(2002) and now the convension gives me errors. I have even gotten errors trying to compile sample cade that was included with the Visual Studio Software. I wish I had the computer in front of me with compiler on it to try things out. but i have to wait till I get home to try anything.
|
|
|
|
|
lubatomy wrote:
the class definition in one file and them the actual code for the functions in a seperate file
These are the same thing. Typically, the declaration of a class typically goes in the .h file, and the definition of a class goes in the .cpp file.
Anyway, at the top of the .h file, do you have something like:
#if !defined(AFX_MYCLASS_H__83972473_D4D1_4923_9BD8_0FD75D2FB39C__INCLUDED_)
#define AFX_MYCLASS_H__83972473_D4D1_4923_9BD8_0FD75D2FB39C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class myclass
{
}
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Can any one of tell me how to get ip address from mac address . i know i can get it by using rarp command but i want to get it by using my program... Thanks in Advance
|
|
|
|
|
That I know of, the IP address is tied to the NIC, but not vice versa. Correct? If so, then you'll need to call gethostname() followed by gethostbyname() .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hello David thanks for ur response but i think those functions wil not work with mac address i suppose ..
they r working only for hostname or ipaddress..
if i am wrong tell me the way for getting ip address from given mac address
|
|
|
|
|
In addition to kuphryn's suggestion, the MAC and IP addresses can also be obtained from GetAdaptersInfo() . I've an example of this if you would like me to send it to you.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
One solution is GetIpNetTable().
Kuphryn
|
|
|
|
|
Hello Kuphryn !! thanks for ur hint.... but by using the GetIpNetTable() function we r able to get the ip address present in our host computer arp entry but i want a function like gethostbyname() which gives ip address of specified system name present in the LAN, bcos in my application i am capturing the mac address i don't know how to get the ip address from that .. the arp entry contain a very few entries only .. if u find any solution please do reply
|
|
|
|
|
it compiles, runs, but makes nothing transparent. my code runs well on WinXP and Win 2000.
in the MSDN is written, that it should also work with win98!
does anybody has a clue? or an implementation of a alphablend funtion?
the code i use is:
//blalba
BLENDFUNCTION blend;
blend.BlendOp = AC_SRC_OVER;
blend.AlphaFormat = 0;
blend.SourceConstantAlpha = 110;//(wichtigster parameter (zw. 0 - 255))
blend.BlendFlags = 0;
AlphaBlend(dcMemBackground, 0, 0, nWidth, nHeight, dcMemForeground, 0, 0, nWidth, nHeight, blend);
thanx, greets
|
|
|
|
|
I belive lot of other apis like this one is OS dependened.
Tech.Support : Mam, is your pc running under windows?
Customer : No actually its close to the main door.
|
|
|
|
|
I am having a difficult time trying to get a value to increment. What I mean is if I have a static control for example called CValue that each time a button is pressed it will increase the value by one. So if CValue = 10 and the button is pressed, I want it to change the value of CValue to 11. Each time I try to do this, the compiler says some crap about converting CString to an int is impossible or something. I cannot remember because I just got out of bed to write this so that I may have a reply by the morning.
Can someone please help me. I know this is easy 'i think' but it has me tickled pink.
Thankyou
Ashman
|
|
|
|
|
Have you tried something like:
CString strValue;
CValue.GetWindowText(strValue);
int nValue = atoi(strValue) + 1;
CValue.SetWindowText(strValue);
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|