|
Hi
i need to write a control that has to be plugged into unmanaged as well as managed UI applications,...
Control Description:
the control is going to be like supporting browsing and searching objects etc,..control have to have mostly UI stff in it(will have some buttons/edit boxes trees and list boxes inside it)....that will have to adjust its controls according to its container,..should support drag and drop from control to the application plugged into that can be managed or unmanaged application...
so should i make an ActiveX control or .Net Windows Control, ?
would like to have your comments on it,..backed up with pros and cons...etc..
Thanks all
Muhammad Ahmed
Ahmed
|
|
|
|
|
I think it depends on who you are building it for. If the client is stupid, and thinks .Net is new and hence better, then create it in .Net. However, I think un-managed apps will have problems with it. (Not sure). And I am not sure, even if it is possible to support the things you need. .Net is new, and you won't find (m)any experts in it.
If on the other hand, you are serious about creating the control, that is easy to use, easy to modify, can be controlled to the finest of details, is real-fast, then go for Un-managed. And you can get help from the Gurus if you ever get stuck.
1- It can contain web-browsers, if you need them.
2- It can contain buttons, list boxes, etc.
3- Can adjust its position, size.
4- Can support drag-drop. (Not sure how .Net apps will behave to that).
this is this.
|
|
|
|
|
Hi to everyone. I write data to a file without problems using CFile and CArchive classes, but the data write in a single line in the file.1) I want to be able to change line in the file. For example, the record Last Name, First Name, Hobby, Age should write in one line.The next record (which append) should become in new line, as it appears delow:
DeliyiannisDimitrisReading23 (First record in the file)
PapadopoulosJohnBasketball20 (Second record in the file)
... ... ... ...
... ... ... ...
2)Ηow can I access diffirent records? For example, if the user enter John OR Papadopoulos OR Basketball OR 20 in an edit box then in diffirent edit boxes display Papadopoulos John Basketball 20.
Please, help me. Thanks.
|
|
|
|
|
1-
If you writing data in the form of text to a textfile, then you can append "\r\n" to every line.
However, if you want the same program to read back the records, then you would be having problems, because you would have appended "\r\n" Carriage-return + Line-feed pair to the data yourself.
2-
To read the records back, read the file line by line like using CStdioFile::ReadString(...). Then parse the text yourself to obtain the values.
this is this.
|
|
|
|
|
Hi ! everyone.
I have to build an editor just like a VB editor in vc++.
please tell me how to go about it. It should hav all the buttons in VB like text box combo box and the buttons should have the properties like font etc. new files and forms should be opened and user should be able to write and save it.user should be able to use the buttons provided and make a form.
Please help me !!
Thanks and regards,
pooja
|
|
|
|
|
I think COM will be the way to go as far as designing is concerned. I think that when you are actually designing the form, that "un-named language" IDE is actually running the form in some way.
Create an MDI project, then the rest will be COM work; like resizable controls at runtime etc. Even the form itself will be resizable.
If I had to do it, I would start writing the controls; starting with the form, then the other controls.
And in which form do you want to save it? That "un-named language" IDE saves forms as binary files. So you will need to do some research on its format.
this is this.
|
|
|
|
|
Can a ANSI-C compliant compiler compile successfully a code containing functions embedded in structure?
hitherto shall thou come but not further thee
|
|
|
|
|
I think C does not support functions in structs. But in C++, structs and classes are very similar, and both can contain functions.
So for a .C file, functions within struct will not compile.
this is this.
|
|
|
|
|
I'm having a table in oracle 9i DB. One of the column(VARCHAR) in this table is stored with unicode string (chinese/japanese characters) .
Problem is if I take a backup of this table using the adodb.recordset.save("file") to file and lattter when adodb.recordset.open("saved file") the chinese character is lost in between any idea why this is hapenning ?
|
|
|
|
|
Hi All
1.I using MFC in my application , and i need to type on screen the preformance of the CPU in runtime.
How can i know the preformance ? what API can i use ?
2.I need to show some FORM (window) that i have in my app. on top, how can i do it ?
Thanks for any halp.
|
|
|
|
|
1-
GetPerformaceInfo(...)[^]
This function get you the needed info, but the requirements are high:
Client: Windows XP
Server Windows 2003
You can also use:
GetProcessTimes(...)[^]
You could enumerate all the processes using EnumProcesses() api, and use GetProcessTimes(...) with it.
2-
You could use:
MFC: SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE);
Win32: SetWindowPos(hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE);
this is this.
|
|
|
|
|
|
Hi
Does anyone know how UNDO operation is handled in explorer. Suppose if a file move is perfomred and undo is done. The file is restored to the original location.
Thanks in advance.
|
|
|
|
|
Hello,
I'm working on a project and am making a c++ application thru windows programming. My program creates a window just fine and can display text through the code below...
HDC hdc;
PAINTSTRUCT ps;
HFONT hFont;
hdc = BeginPaint (hWnd, &ps);
hFont = (HFONT) GetStockObject ( SYSTEM_FONT );
SelectObject (hdc, hFont);
SetTextColor (hdc, RGB(0,0,180));
SetBkColor (hdc, RGB(190,180,200));
SetTextAlign (hdc, TA_LEFT);
char *string1;
string1 = new char[20];
lstrcpy (string1, " ");
TextOut (hdc, 10, 10, string1, lstrlen(string1));
EndPaint (hWnd, &ps);
However, I need a way of removing the text that was displayed. This would happen after a button click or something else along those lines. Also, does anyone know an easier way to display text, I think I am jumping through extra hoops when I use the code above. And finally, does anyone know how to make a windowed application run in the background?
Thanks, Roy K.
|
|
|
|
|
To remove the text I think you can repaint the window, without drawing the text, like send a WM_PAINT message :
::SendMessage(hWnd,WM_PAINT,0,0);
To display text, you are allocating memory every time. You could create a fixed size character array like:
char str[200];//make it large enough for the string.
And if you have to make it dynamic, then you must delete it also:
str = new char[20];
delete[] str;
I don't really understand what you mean by running in the background. You can minimize the application, you can even hide the main window (then you should have a way to restore it, like a notification area icon etc).
Minimize: ::ShowWindow(m_hWnd,SW_MINIMIZE);
Hide: ::ShowWindow(m_hWnd,SW_HIDE);
this is this.
|
|
|
|
|
It may be a C++ application, but this is almost C compatible code. The only thing that keeps it from being C code it the declaration "char *string1;", after making function calls.
You'll still need to write code like that, but you can simplify by placing the code for drawing the text in a seperate function.
MyTextOut(HDC hdc, int x, int y, char* pStr)
You do not need to allocate any memory for the string in the given code, since you already know what the string contains.
const char *string1 = "";
You would not need to do the above accept that it is easier to use lstrlen than to do some thing like this:
TextOut (hdc, 10, 10, "", lstrlen(""));
or this
TextOut (hdc, 10, 10, "123", 3);
You should restore the previous font to the DC out of habit:
HGDIOBJ hOldFont = SelectObject(hdc, (HFONT)GetStockObject(SYSTEM_FONT));<br />
......<br />
SelectObject(hdc,hOldFont);<br />
EndPaint(hWnd, &ps);
Whoops, I got carried away!
Ways of erasing the text:
1) Invalidate the window and do not draw it again.
2) Call GetTextExtentPoint32 and calculate the window rectangle where you displayed the text. Save the rectangle some where. Then just invalidate that rectangle when you want to earase it and do not draw it again. This method is faster, because you do not need to redraw the entire window (which is slow).
Note: Calling GetTextExtentPoint32 is equivalent to calling MFCs CDC::GetTextExtent method.
There are other ways, just let your imagination run free.
INTP
Every thing is relative...
|
|
|
|
|
I used three webbrowser ctrls in my application. but it used nearly 70MB memory and it seemed that it would never reduced. Is there any way to reduce the memory usage? I found that many tabbed browsers won't use so much memory enven more than ten window were opened. but there were only three in my application.
Thank you very much and happy new year.
|
|
|
|
|
//kenar means edge
#ifndef KENAR_H
#define KENAR_H
enum {COLLINEAR, PARALLEL, SKEW, SKEW_CROSS, SKEW_NO_CROSS };
#include "Nokta.h"
#include "float.h"
class Edge{
public:
Point org;
Point dest;
Edge(Point &_org, Point &_dest);
.
.
.
error C2146: syntax error : missing ';' before identifier 'org'
error C2501: 'Point' : missing storage-class or type specifiers
error C2501: 'org' : missing storage-class or type specifiers
error C2146: syntax error : missing ';' before identifier 'dest'
error C2501: 'Point' : missing storage-class or type specifiers
error C2501: 'dest' : missing storage-class or type specifiers
|
|
|
|
|
|
|
wann't it because of the Case typo, "Point" for "POINT"
Vipin - MVP
|
|
|
|
|
wasn't it because of the Case typo, "Point" for "POINT"
Vipin - MVP
|
|
|
|
|
You are missing a semi-colon, and based on the code you posted I would say probably in the file 'float.h'.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
In my work space there are two projects, one is dll another is application which calls dll. they are in different folder. in VC IDE, is there a way to add the dll path to the PATH variable, or let IDE search the dll path when application runs?
Thank you.
|
|
|
|
|
Tools->Options->Directories->Exectuable paths
|
|
|
|
|