|
You have two options:
i) Use GetWindowRect (which gives you rect in terms of screen coordinates) and then convert it using ScreenToClient. Then add the offset that you want to have for your list control from the top-left of your dialog.
ii) Use GetClientRect (which will directly give you the rectangle of YOUR COMPLETE DIALOG). So you need to add some offset to the top-left point (which is (0,0) right now), and subtract some offset from the bottom-right point.
Ravi Sankar S wrote:
At this time the value returned {0, 292, 0, 467} This time it draws at the top of the client area.
So from your description, I think using the rect {10, 250, 10, 400} would perhaps suit your needs.
Regards,
Pravin.
|
|
|
|
|
COCreateInstance() call failed from MFC client when trying to call the
interface for ATL COM EXE(LOCAL SERVER)...Any solution or workaround
|
|
|
|
|
any chance to see a piece of code and/or an error message ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Look at my earlier cry for the same error ..
http://www.tech-archive.net/Archive/Data/microsoft.public.data.oledb/2004-03/0086.html
it was mainly due to usage of improper or outdated usage of some header files ...
Look at the parameters passed in cocreateinstance() function and check if all the params are present in your relevent headers
redindian
|
|
|
|
|
Hi,
First did you initialize the COM subsystem by using COInitializeEx()...
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
HI all
I have the following problem .
I have a COblist member declared as protected in a class
CObList m_DataList;
Now in the virtual destructor of the same class
the data is cleaned up like this...
while(!m_DataList.IsEmpty())
delete m_DataList.RemoveHead();
...here assume the m_DataList has N elements ...
deleting N-1 elements is not a problem ..but when the Nth element is Removed from the m_DataList then Assertion occurs ..saying
Invalid heap pointer !! . I could not understand this at all ..
When the destructor is able to delete all the elements except the last one what could be the problem ?
Why should I face assertion when the last element is deleted ?
Can someone help me pls ?
dharani
|
|
|
|
|
Did you add the same object to the array more than once? If so, it would harf on deleting the duplicate.
What type of classes are you adding to the array? Are they all the same class, or is the last one different than the rest, and if so, does it have a virtual destructor?
He is smart. He will make our Windows go.
|
|
|
|
|
Hi Jack
I will check this point .In fact the destructor of the class is virtual one ..I will update you tomorrow ... pls give me idea after i post a proper response ..
thanks
redindian
|
|
|
|
|
for Mr Toxcct
i dont know how to proceed it if
if(...)i.e after ur coding now what i write in my case.
------------------------------------------------------
for all members
till now i did not get any fuitefull response.
please help me more.
-----------------------------------------------------
;sdfsd
;sdfsd
;sfhsd
;nfs
;gfsfjgsf
;X Y index
12 34 2333
14 56 3334
12 56 7895
;sdkfskd
;sdhfkjd
45 34 3433
------------------------------------------------
in the above file the line started with SEMICOLON will be consider as comments i.e i have to read only the lines stating without SEMICOLON and all lines starting from SEMICOLON will show an error exception and read that line that start without SEMICOLON.
so how can i read the above format of file reading.
waiting for + response.
david
|
|
|
|
|
hey David,
i saw you post, there was no need to repost :
1) the 1st one did not disapear from the screen
2) you didn't even gave me the time to answer...
3) i receive a mail when you answer to me
(
ok, now, the tests in the if will almost depend on how the file is formated, and what you want to make upon ...
as i didn't well understand what does the file contain (and as it is your job to think on it ), i just provided a base of code which you can complete depending the file content :
CString strFile = "theFile.txt";
CString strLine;
std::ifstream SourceFile(strFile);
char buffer[50];
while (!SourceFile.eof() && ::PathFileExists(strFile)) {
SourceFile.getline(buffer, sizeof(buffer));
strLine = buffer;
if (!strLine.GetLength()) break;
if (strLine[0] == ';') break;
}
SourceFile.close();
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I know this has been answered at least twice in the past, yet you do not indicate what is not working, or what you do not like, about those suggestions.
CStdioFile file("", CFile::modeRead);
CString strLine;
int XLOC, YLOC, INDIX;
while (file.ReadString(strLine) != FALSE)
{
if (strLine[0] != ';')
sscanf(strLine, "%d %d %d", &XLOC, &YLOC, &INDIX);
} If this does not work for you, indicate what is not right rather than create a new thread asking the same question. Problems are much easier to solve/track this way.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
i didn't proposed such a line reading as i wasn't sure if every lines were formated the same way (x, y, indix)...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i have a problem about overload operator =
this is my code
CStringList& CTESTADOView::operator =(CStr &str)
{
this->lst=str.list;
return(lst);
}
: error C2582: 'CStringList' : 'operator =' function is unavailable
can anyone tell me where the wrong??
thanks in advance~~~!
nothing
|
|
|
|
|
From the compiler message: There is something wrong with = overloaded operator of CStringList. This means that there is no overloaded operator = for CStringList hence you cannot assign one List to another like you did. You will have to use some alternative method to do this like copying all the elements of one list to the other in a loop.
e.g., something like:
for(int i=0; i<str.list.GetCount();i++)
{
this->list.AddTail(str.list.GetAt(i));
}
<Font size = 1 color = red>
Steve Mayfield: "Coding in VB is like riding a tricycle...once you figured out how to peddle, its really hard to fall off."
</i></Font>
<a href='http://www.codeproject.com/script/Articles/list_articles.asp?userid=163403'> My Articles</a>
|
|
|
|
|
to sum Aamir up, you dont call the same function that is define in the CStringList class... check the parameters, their types...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
How can I change the border of listctrl?
Can you suggest any useful link?
Tanks in advance!
|
|
|
|
|
i have this tiny problem...
i have this program running in a GUI mode and i want it also to run in the command line.
i want it to have the following command line output:
hello there. this is the command line version of this program.
press enter to continue...
how would i run that program in a command line without making the GUI appear.
|
|
|
|
|
i'm not sure i understand. isn't the following working ?
#include <stdio.h>
#include <conio.h>
void main(void) {
printf("hello there. this is the command line version of this program.");
printf("press enter to continue...");
getch();
}
otherwise, please give some some for us to understand you request.
thanks
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
my program originally runs with a GUI. the problem is i want to run the same program with the command line without making the GUI appear.
thanks for your reply...
|
|
|
|
|
i'm not sure what you call GUI here... if it is a console mode executable, is it the border of a console window that you want to hide ?
this way, if you Alt+Return you will put the window in full screen, so no border anymore ...
otherwise, please detail more...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
let's put this way. i have develop a GUI for my software. I want my software to run in a GUI mode and CLI mode. the problem is everytime i run the my software in the command line my GUI appear instead of printing the following:
this is the command line version of this software
press enter to continue...
the problem get's bigger now...
my software need to perform command line parsing...
thanks for the reply...
regards...
|
|
|
|
|
It is not possible stright away to make a program to run withour GUI .
You have to give some input ..like with which the code is written ...is it VC++ / VB or what ?
Assuming it is VC++ , if u have a GUI app, then it must be either dialog based or document view based (SDI MDI)..
If its SDI , MDI it is not possible to convert the whole app withour impacting the functionlity of it .
If it is dialog based , there is a 100% possiblity to make it run in cmd line ...still
the data retriveal mechanism etc etc has to be made to run in concurrence with plain windows APIs not with MFC dependecies like CEDit etc etc
Give us more input ..
|
|
|
|
|
here is the twist. My application is dialog based. I could identify where did the user call my software (e.g. if the user call it in the command line or if the user click it's icon. My problem is i could not print in the command line. if i call my application in the command line i no printing in the command line will happen.
what i really want is to make my software run in both GUI mode and CLI mode. i could make it run in GUI mode but i cant run it using the command line. i would like it to run in one mode at a time. if the user prefer to run it in GUI mode the all its functionalities should run in GUI mode. if the user prefers to run it in CLI mode all it's functionalities should run in CLI mode.
thanks for the reply...
regards...
|
|
|
|
|
What kind of application do you have ? Plain Win32 ? MFC ?
If MFC, ihe best way to do this would be to have the executive tasks of your program located in User Interface independant classes (e.g. do not locate all computation functions in the MFC GUI derived classes), and call these tasks from the InitInstance function (e.g. if there are command line options when parsing the command line in InitInstance, do not call all the MFC GUI part).
~RaGE();
|
|
|
|
|
my software supports MFC. my software functionalities are all in different classes. I would like my software to run in one mode at a time. if the user chooses to run it in GUI mode then all my functionalities should run in GUI mode. I have no problem with that. The problem comes in if the user chooses to run it in CLI mode.
thanks for the reply...
regards...
|
|
|
|