|
You can only see the last 200 of your own posts from your profile.
Posts[^]
Otherwise you'll have to use the Search comments facility that is at the righthand side of the forums bar, next to the Set Options button.
Michael
CP Blog [^]
|
|
|
|
|
right,
it is from clicking "search comments" on top.
i never use this feature before.
thanks
includeh10
|
|
|
|
|
If a friend of mein works on the same application like I do and in the end we want to bring all the program's parts together, what should we do.
For example we have a MDI and a dialog based application.We want the DIALOG BASED App to depend on MDI. What should we do and how should we work with dialog based classes and variables from MDI app ?
|
|
|
|
|
hi victor ,
in ur case , in a source code file in the DIALOG based app , declare
those variables which u want to use from MDI app using extern keyword as a prefixx .
imagine that u want to use two variables of type double (dbl) and long (lng) from MDI app. (The same can be true for classes/objects also )
in a source file (int the Dialog app ) when u declare variable use the keyword
extern long lng;
extern double dbl;
( i am assuming that u fl and dbl is those variables u want to share )
Hope this helps.
Praseed Pai
www.praseedpai.com
|
|
|
|
|
And how should I add the dialog based project to the MDI,simply adding it as new resources? I've already tried that and I got a lot of errors because of the conflicts between the .res files (the MDi res file and the DIALOG based res file).
------ maybe I didn't understood it well. Is that what you wanted to say ?
|
|
|
|
|
Is there any possibility to link the 2 project into a solution using a dll or a lib file ? I remembered I'd read smth about it on a site but i can't remember exactly how to do it and if it's possible.
|
|
|
|
|
Victor Paraschiv wrote:
If a friend of mein works on the same application like I do and in the end we want to bring all the program's parts together, what should we do
Use a program called Microsoft Visual SourceSafe or similar. This program, and others like it, upkeep a database of source files, and manages the locking/releasing of source files that are being edited by someone. For example, if you have a team of programmers working on the same project, then this is ultimately the best solution: when someone has checked in with a certain source file (checked in means that he/she is editing it), no other person can edit the source file simultaneously. If you need a free solution, the CVS Tree in SourceForge may be a valid approach. Haven't tested it myself, though.
As for the example you presented, did you know that the dialog app project of yours actually consists of a dialog class, the dialog template resource, and a small CWinApp-derived application class used to create and display the dialog ? If you wanted to use this dialog in another program, you would only need to move the dialog class and the resource file over. Naturally, before this moving can occur, you must make sure that the destination project has no duplicate IDs or class names. The easiest way is to take the dialog project as a reference, then create similar classes and dialog templates into the MDI app, create necessary handler functions, then copy/paste the actual code (contents of functions) from the old project to the new one. This ensures that although the IDs may change, the names that refer these IDs remain the same without a hassle.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
In my app I want to use the dialog based app toghethere with MDI. It is simply to much work to do to copy/paste all the cpp-s and header files from a project to another. I just want to build them together considering that they are different modules from a program and I want to pass parameters and functions between them.
Isn't there another posibility than the other 2 described by you? In the first case I think I complicate far to much for what i want to do. What about using dll-s and lib files. Cand you tell me something about them ?
|
|
|
|
|
Is there any way to find out whether desired service is running on the remote port?? i am just scanning for well known ports
|
|
|
|
|
How do i write an application so that it does not run when opened by any user other than administrator? my application is a dialog based application. so i do not want to initialise my dialog when i m not administrator. i just want to show a message box saying the application runs only as administrator. how do i check administrator rights through a VC++ program?
suggestions needed.
|
|
|
|
|
This is a reply to a similar question that I copied from a forum:
[Reply]
This piece of code should be what you are looking for. Also, the article Searching for a SID in an Access Tokenin the Widows Base Services: Platform SDK on the MSDN Library Visual Studio 6.0 will help.
HANDLE hToken = NULL;
PTOKEN_GROUPS pGroupInfo = NULL;
DWORD dwSize = 0;
DWORD loop = 0;
PSID pSID = NULL;
BOOL bSidCheck = FALSE;
SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken);
GetTokenInformation(hToken, TokenGroups, NULL, 0, &dwSize);
pGroupInfo = (PTOKEN_GROUPS)new BYTE[dwSize];
GetTokenInformation(hToken, TokenGroups, pGroupInfo, dwSize, &dwSize);
/**** well-know SID *****/
//DOMAIN_ALIAS_RID_ADMINS
//DOMAIN_ALIAS_RID_USERS
//DOMAIN_ALIAS_RID_GUESTS
//DOMAIN_ALIAS_RID_POWER_USERS
//DOMAIN_ALIAS_RID_ACCOUNT_OPS
//DOMAIN_ALIAS_RID_SYSTEM_OPS
//DOMAIN_ALIAS_RID_PRINT_OPS
//DOMAIN_ALIAS_RID_BACKUP_OPS
//DOMAIN_ALIAS_RID_REPLICATOR
// Creating a SID for the BUILTIN\Administrators group. Could use others
AllocateAndInitializeSid(&SIDAuth, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS,0, 0,0,0,0,0, &pSID);
for(loop = 0; loop < pGroupInfo->GroupCount; loop++)
{
// Check All Groups to see if a match to the ADMIN SID that was created if(EqualSid(pGroupInfo->Groups[loop].Sid, pSID))
{
bSidCheck = TRUE;
break;
}
}
delete [] pGroupInfo;
CloseHandle(hToken);
if (pSID)
{
FreeSid(pSID);
}
if (pGroupInfo)
{
GlobalFree(pGroupInfo);
}
if(bSidCheck)
{
//came back with a Match
}
else
{
//No Match
}
[/Reply]
If you vote me down, my score will only get lower
|
|
|
|
|
In A dialog based application where should i put this code segment. in initDialog()?
|
|
|
|
|
I try to get a notification when the user change the current selection in a CListCtrl.
It is possible to get one whith the NM_CLICK event (when the user clicks on it), but I don't know how to get the new selection when the user changes the current selection width the arrows ...
is there any message like TVN_SELCHANGED (for CTreeCtrl) ?
Thx.
--
Gizmo
|
|
|
|
|
Simply provide a handler for the LVN_ITEMCHANGED notification. The iItem member of the NM_LISTVIEW structure will be the number of the selected item. Or, you can just call GetNextItem(-1, LVNI_SELECTED) .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
ok, it works, thx
--
Gizmo
|
|
|
|
|
HI,
As i Windows Media Player ,, the Title bar Portion of Meia plauer hides when we select the option of Auto Hide menu bar ....
How can i do it with my dialog ,, assume it is a simple dailog with a Menu bar , etc and few buttons.
waitng for sample help
thanks
|
|
|
|
|
You can hide controls via the
ShowWindow(SW_HIDE)<br />
ShowWindow(SW_SHOW)
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I want to Hide Title bar and Some Portion of Dialog
as follows
______________________________________
| Title Bar + Menus |
|_____________________________________|
| | |
| | |
| | |
| | |
| | |
| | Button1 |
| My Picture Window | |
| to play video | Button 2 |
| | |
| | |
|_____________________________________|
1... I want to hide Title Bar and Menus
Plus if possible
the Portion where the Button , i want to hide this also
thanx
|
|
|
|
|
I did once a trick by setting a groupbox around the controls.
This groupbox' rectangle is exactly the rectangle to hide. You can then redraw your video window.
how to hide your menu I don't know.
here's some sample code I've used.
CRect filterrect;
CRect flexlistrect;
CRect hsbtnrect;
CWnd* pWnd;<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC3);<br />
pWnd->GetClientRect(filterrect);<br />
m_lstActivations.GetClientRect(flexlistrect);<br />
m_btnhideshow.GetClientRect(hsbtnrect);<br />
<br />
topoflisthidden = hsbtnrect.bottom + 15;<br />
topoflistshown = filterrect.bottom + hsbtnrect.bottom + 15;<br />
bottomoflisthidden = flexlistrect.bottom + filterrect.bottom + hsbtnrect.bottom - 5;<br />
bottomoflistshown = bottomoflisthidden - (filterrect.bottom);<br />
widthoflist = filterrect.right;
<br />
if(showed == false){<br />
sortcol = 2;
CWnd *pWnd;<br />
pWnd = (CWnd*)GetDlgItem(IDC_COMBO_COLUMN);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_EDIT_COLUMNVALUE);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC2);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC_SORT);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC_VALUE);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_COMBO_SORTCOLUMNS);<br />
pWnd->ShowWindow(SW_HIDE);<br />
<br />
m_lstActivations.Clear();<br />
m_editcolumnvalue.SetWindowText("");<br />
m_combocolumn.SetCurSel(0);<br />
<br />
sessionsettings->filtercol_inpat = 0;<br />
sessionsettings->filtervalue_inpat = "";<br />
sessionsettings->selectedrow_inpat = 1;<br />
sessionsettings->sortcol_inpat = 0; <br />
sessionsettings->showed_inpat = showed;<br />
<br />
HICON icon;<br />
icon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_SHOW), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
m_btnhideshow.SetIcon(icon);<br />
<br />
m_lstActivations.MoveWindow(0 + 15 - 3, topoflisthidden, widthoflist-1, bottomoflisthidden);<br />
showed = true;<br />
}
else{<br />
if(m_combosort.GetCurSel() != -1){<br />
sortcol = m_combosort.GetCurSel() + 2;
}
m_lstActivations.MoveWindow(0 + 15 - 3, topoflistshown, widthoflist-1, bottomoflistshown);<br />
CWnd *pWnd;<br />
pWnd = (CWnd*)GetDlgItem(IDC_COMBO_COLUMN);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_EDIT_COLUMNVALUE);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC2);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC_SORT);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC_VALUE);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_COMBO_SORTCOLUMNS);<br />
pWnd->ShowWindow(SW_SHOW);<br />
<br />
HICON icon;<br />
icon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_HIDE), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
m_btnhideshow.SetIcon(icon);<br />
<br />
sessionsettings->showed_inpat = showed;<br />
m_editcolumnvalue.SetFocus();<br />
showed = false;<br />
}
m_btnhideshow.SetButtonStyle(BS_PUSHLIKE|WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_ICON|BS_TOP|BS_LEFT);<br />
m_PrintList.SetButtonStyle(BS_PUSHLIKE|WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_ICON|BS_TOP|BS_LEFT);<br />
HICON printicon;<br />
printicon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_PRINT), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
m_PrintList.SetIcon(printicon);<br />
<br />
CRect rect, rect1, rect2, rect3;<br />
CWnd* pWnd;<br />
pWnd = (CWnd*)GetDlgItem(IDC_LIST_ACTIVATIONS);<br />
pWnd->GetClientRect(rect1);<br />
rect3.bottom = 16 + 5;<br />
rect3.top = 5;<br />
rect3.right = rect1.right;<br />
rect3.left = rect1.right - 16;<br />
m_PrintList.MoveWindow(rect3, TRUE);<br />
m_PrintList.GetClientRect(rect2);<br />
rect.bottom = 16 + 5; <br />
rect.top = 5;<br />
rect.right = rect1.right - rect2.right - 5;<br />
rect.left = rect1.right - rect2.right - 5 - 16;<br />
m_btnhideshow.MoveWindow(rect, TRUE);<br />
UpdateWindow();<br />
if(initializing == false){<br />
OnRefresh();<br />
}
<br />
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I want to implement Client/Server Application between Windows and Solaris Machine.Client can communicate to different Solaris Machines.How to handle Multiple socket connections and all socket connections I want run as threads.
Can give any idea or any examples please.
|
|
|
|
|
hi ,
Ur question does not describe the context in which ur running ur application.
I am assuming that ur running a custom TCP/IP server seevice on a solaris
machine. (Otherwise , how ur Client will communicate to Solaris machine ?)
And client machine seems to be windows.
If u take any book on socket programming , that will show u how u can
write a rudimentary server ( some books even deal with HTTP servers )
Basic idea is as follows
ur server will wait for the connection. There are steps
like calling socket function , binding the socket with protocol port address
etc.
When a client initiates a call to the server. Server will create
a new thread or task ( using posix threads package or unix fork function )
and the new request will be handled by the threads. So learn Berkely socket API , Posix threads , Unix fork etc. And try to refer following books
Unix network programming by Richard stevens is the place to go for
Linux / Unix programmers
Winsock programming by Lewis napper will give u idea about Windows socket programming
U can also read Interetworking with TCP/IP by Douglas comer. A chapter on socket programming is there.
Praseed Pai
www.praseedpai.com
|
|
|
|
|
Thank u for reply.I gave lot of inputs to me.I implemented Single threaded Apps.Now that I want convert into multithreading.I was getting Segmentation Fault (core dumped) error.pl tell me How to avoid this?
Thanks in advance
dadsadasd
|
|
|
|
|
Sorry Correction in last reply.Instead of I replace with U.
dadsadasd
|
|
|
|
|
Hello 2all!
I've a simple problem (hopefully):
My visual c++ application have to map a smb share (like typing "net use z: \\server1\c$ ...") at the DOS-prompt. How do I figure this out?
I've tried out the shellexec command but this isn't working properly.
Is there another method to access files lying on a smb share directory on a server?
- Jan
|
|
|
|
|
Look at the WNetAddConnection() , WNetAddConnection2() and WNetAddConnection3() functions on MSDN.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|