|
Thanks alot, got it working. Got one small problem left though. When I call AfxGetAppName() in the dll it generates an assert.
Is there any other way of getting the application name?
Again Thanks
Mark
|
|
|
|
|
GetModuleFileName with NULL for the hModule -parameter should do the trick.
|
|
|
|
|
Hi!
when your DLL is loaded, you have to store
the Handle of it somewhere in your DLL...
and then create something like this:
CDialog * CreateBox() {
HINSTANCE hMainRes = AfxSetResourceHandle(_SavedHinstance);
CMyBox pBox = new CMyBox();
AfxSetResourceHandle(hMainRes);
return pBox;
}
or somthing similar....
|
|
|
|
|
i don;t know why you facing the problem
i myself using the dialog box from MFC Ext DLL.
if you want some sample code i will give you
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi,
I'm trying to draw an arrow in a DC. i have a line, consisting of the starting point(aa) and the ending point(bb). (CPoint variables) I do a Moveto (aa) and then a LineTo (bb).
What i want to do, is like a triangle, the end of an arrow (or just two lines), but i haven't came up with ideas. The problem is that the line can be in any direction, not just horizontal or vertical.
how could i do that with just aa and bb(the start and end of the line)??
thanks!!
|
|
|
|
|
If you want to use GDI+ you can use the Pen::SetStartCap() and Pen::SetEndCap() functions to have GDI+ draw the arrow heads for you. AFAIK, with GDI you have calculate and draw the arrow heads yourself.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I'm using visual c++ 6.0, can i use GDI+?
|
|
|
|
|
|
thanks!
i'm getting this error:
fatal error C1083: Cannot open include file: 'gdiplus.h': No such file or directory
should i download microsoft's latest sdk?
sorry for the questions, i'm kind of a beginner in this
|
|
|
|
|
yes, which is explained in this article on codeproject
http://www.codeproject.com/vcpp/gdiplus/startinggdiplus.asp[^]
which you can find by doing a Google search. You will find that productivity in software development is directly related to your ability to search for, read and understand documentation, articles and examples... even the bad ones
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
|
i am wanting to read from a file and delete it when ive finished reading
problem is the file is constantly been written to
if i use MoveFile then read the contents, then continue doing that, i end up having bits of the log missed out
i know that if i rename using explorer, none of the log info gets lost
does anyone know how explorer renames a file so i can do it the say way?
|
|
|
|
|
Have a look at SHFileOperation()
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
hello evryone
i'm triening to builed a little popup menu for my app , this app has allready got a toolbar menu , and i'm trieng to builed a popupmenu that will be shawn on right click .
hers what i do :
case WM_RBUTTONUP:
//get current position of mouse curser
thisPoint.x = LOWORD(lParam); // x co-ordinate
thisPoint.y = HIWORD(lParam); // y co-ordinate
// Load the menu resource.
if ((hmenu = LoadMenu(hInst, "POPUPMENU")) == NULL)
return(1);
// TrackPopupMenuEx cannot display the menu bar so get
// a handle to the first shortcut menu.
hmenuTrackPopup = GetSubMenu(hmenu, 0);
TrackPopupMenuEx(hmenuTrackPopup,
TPM_LEFTALIGN | TPM_TOPALIGN |TPM_LEFTBUTTON,
thisPoint.x, thisPoint.y, hwnd, NULL);
// Destroy the menu.
DestroyMenu(hmenu);
return(0);
now - the hmenu and the hmenuTrackPopup are 2 HMENU structures that i declared in the WndProc non of them is pointing to the toolbar menu that i intilized when i initiliazed my main window ( wc.lpszMenuName = szAppName ).
the "POPUPMENU" is the menu that i allredy builet and is declared in my resource.h
i'm working in visual C++ ( not .NET ).
when i'm clicking the right mouse button i get nothing - can someone please help in telling me what am i doing wrong ????
or can reffer me to a good example on how to builed popup menu ?
thanx alot
|
|
|
|
|
try this:
CMenu popupMenu;
popupMenu.LoadMenu(IDR_MENU_POPUP_CTACTOS);
CMenu* subMenu = popupMenu.GetSubMenu(0);
CPoint ptPopup;
GetCursorPos(&ptPopup);
subMenu->TrackPopupMenu(TPM_LEFTALIGN, ptPopup.x, ptPopup.y, this);
|
|
|
|
|
helloo all fellow prgrammer
i am facing some problem,i am using Network management class made mr Carlos Antollini.
i am able to create the user,but i am unable to provide him priviledge. can any one help me.
the sample code is am using is as follow
-----------------------------------------------------
CNetLocalGroups a;
CNetUsers b;
#1 Problem User created with no privildge
if(b.Add("lopopo","")==0)
{
MessageBox(a.m_strError);
}
else
{
MessageBox(a.m_strError);
}
problem #2 this code give me this error "One or more of the members specified do not exist. Therefore, no new members were added."
if(a.AddUser(str1,"lopo")==0)
{
MessageBox(a.m_strError);
}
else
{
MessageBox(a.m_strError);
}
I Think It will Work
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Soory i have solved my problem
the class work in this way
first create the user from CNetUser class
then
from CNetLocalGroup add the group to above created user.
thanks any way
I Think It will Work
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
When I create a vector and its iterator of GraphicsPath class of GDI+ object as shown in the following, it produces a compilation error. What can be the reason for this error and How can it be fixed ?
std::vector<graphicspath> m_Paths;
or
std::vector<graphicspath>::iterator pathIter;
Compilation error
Compiling...
ImageMarkerView.cpp
d:\Programs\Microsoft Visual Studio .NET 2003\Vc7\include\vector(810) : error C2248: 'Gdiplus::GraphicsPath::GraphicsPath' : cannot access protected member declared in class 'Gdiplus::GraphicsPath'
d:\Programs\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\GdiPlusPath.h(862) : see declaration of 'Gdiplus::GraphicsPath::GraphicsPath'
d:\Programs\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\GdiPlusPath.h(18) : see declaration of 'Gdiplus::GraphicsPath'
d:\Programs\Microsoft Visual Studio .NET 2003\Vc7\include\vector(809) : while compiling class-template member function 'void std::vector<_Ty>::_Insert_n(std::vector<_Ty>::iterator,std::vector<_Ty>::size_type,const _Ty &)'
with
[
_Ty=Gdiplus::GraphicsPath
]
e:\Work\Cpp\ImageMarker\ImageMarkerView.h(75) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
with
[
_Ty=Gdiplus::GraphicsPath
]
Build log was saved at "file://e:\Work\Cpp\ImageMarker\Debug\BuildLog.htm"
ImageMarker - 1 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
|
|
|
|
|
Dear Friends,
I want to create System DSN programatically. How can i do so ??
Imtiaz
|
|
|
|
|
Create The following Regsitry Key
"SOFTWARE\ODBC\ODBC.INI\MyDSN" in the HKEY_LOCAL_MACHINE
Then add the following string values "Database", "Description","Driver", "LastUser", "Server" and set their values
Last add the name of your DSN to the HKEY_LOCAL_MACHINE "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources" Key as a string
Functions you need are
RegCreateKey
RegSetValueEx
RegCloseKey
cheers
Raz
It is Illogical to define an inventor by his invention
|
|
|
|
|
See the API SQLConfigDataSource()
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
HI how r u ?
Hoping u r looking like an overloaded opertater.
n ur time is static.
but ur Friend is accessing ur privates. is it.
allocate him/her his place....
not xposing every thing to public..
i think u got my points..
is it ..
or noo..
if not ten optizie r copilers ..
ok
zahid ash
N.D. Technologies
zahid_ash@yahoo.com
|
|
|
|
|
do u know? help me plz, thx.
|
|
|
|
|
Look for WM_POWERBROADCAST
and return BROADCAST_QUERY_DENY
<br />
case WM_POWERBROADCAST:<br />
MessageBox (hWnd, "Colsing Why, We've just met ","System CLosing??",0);<br />
return BROADCAST_QUERY_DENY;<br />
Cheers
It is Illogical to define an inventor by his invention
|
|
|
|
|
I would like to encyrpt the contents of my program before I write them to a file. How do I go about encypting the data before I write it to a file, (at the minute I am using serialization). One limitation is that I don't want to serialize the data to a temporary file and then encrypt the file as if the unencrypted file still exists then the data is not secure.
Could someone please just get me started, as I am not sure where to look as many encryption tutorials on this site encrypt and decrypt a file that already exists, I want to encrypt data in memory and write it to a file encrypted, then read the encrypted data back into the program's memory.
Thanks a lot
|
|
|
|