|
See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello everybody!
I use a static lib (ANSI because of 3rd company libs included there which requires ANSI) and would like to use it in a unicode application.
Does someone know from expierence if there are any problems??
does some have further information, because it's very hard to find information about this topic??
Thanks and best regards
Mathias
|
|
|
|
|
neyerMat wrote: Does someone know from expierence if there are any problems??
No problems, provided you convert strings from you application before passing them to the library and viceversa.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks Pallini!
I never thougt that simple!
so long
Mathias
|
|
|
|
|
And as a side note, u even don't want to convert the strings, provided u r using the ANSI version of API for that particular strings
|
|
|
|
|
Using HtmlHelp with HH_DISPLAY_TEXT_POPUP to display a context-sensitive help in arabic, where the extended style of the owner window is set to WS_EX_LAYOUTRTL, results in displaying the help-text in a correct right-to-left order, but the entire multiline text is still left-aligned.
How do I set the right-alignment of the text in the help-popup window ?
|
|
|
|
|
I must install which Windows Components before I install Visual Stduio 2003?
I insert the CD1 of VS2003, it always tell me to restart computer.
The restart message is as below:
http://www.game.csie.ndhu.edu.tw/~akira/Else/vs2003error_eng.JPG
|
|
|
|
|
|
i am using windows XP and Visual Studio 2005
|
|
|
|
|
Have a look at [^]. It is a .NET article, I know, but may be useful.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
dear all
how to determine size of Gaussian mask when sigma is changed? any formula is available for this case. thanks a lot.
Li Zhiyuan
|
|
|
|
|
Why don't you google for? [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
thanks, brother, i searched for many times, couldn't get it.
Li Zhiyuan
|
|
|
|
|
i have project which contains a service application and window based application, When the window receive a message i need to pass some information regarding message ( a structure ) to the service. How to do that ?
Thanks
|
|
|
|
|
I once did that using COM connection points, it was hard but very fast. A Windows Sockets loopback would probably have been easier, any form of IPC (InterProcess Communication) would do the trick but stay away from DDE (Devilish Data Exchange). Some people get on with memory mapped files and other don't. Rumours of COM runtime shared memory implementations persist despite the horror of such a thing and there are all sorts of off the shelf bits of middle ware and messaging frameworks gathering dust and waiting for someone to turn them into applications.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
have a look at ControlService() API and make of user-defined control code.
if not suitable, i think IPC is the option as mathew already said.
|
|
|
|
|
Rajkumar R wrote: have a look at ControlService() API and make of user-defined control code.
It looks like that ControlService can only send code but can not take additional data with the code?! (Something like wParam and lParam stuff)
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: It looks like that ControlService can only send code
yes.
Maxwell Chen wrote: but can not take additional data with the code?! (Something like wParam and lParam stuff)
he doesnot want to pass the Window message as it
nitin3 wrote: When the window receive a message i need to pass some information regarding message ( a structure ) to the service.
he want to pass some info regarding the message.
if he can do it as unique code, much of work to implement IPC is avoided. otherwise IPC, that already i meantioned in my reply.
|
|
|
|
|
Third time I am posting the same question but nobody answrered it. Is this tricky question or anything else.
I have written a ContextMenuHandler in VC++, creating a Right-Click for all files (*) and all works really well except that it does not handle .lnk files.
With .lnk files I can only get the target file (eg an exe file) .
Can anyone tell me how to get the .lnk file path?
My code to retrieve the file name is as follows:
<br />
void CCoMenHandler::GetSelectedFiles(LPCITEMIDLIST pidlFolder,IDataObject *pdtobj)<br />
<br />
{<br />
<br />
g_szSelectedFiles.RemoveAll();<br />
<br />
if (pdtobj) <br />
{<br />
pdtobj->AddRef();<br />
<br />
STGMEDIUM medium;<br />
FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};<br />
<br />
HRESULT hr = pdtobj->GetData (&fe, &medium);<br />
if (FAILED (hr))<br />
{<br />
g_bRecyleBin=TRUE;<br />
GetRecycleBinFiles();
return ;<br />
}<br />
g_bRecyleBin=FALSE;<br />
char path[MAX_PATH];<br />
<br />
UINT fileCount = DragQueryFile((HDROP)medium.hGlobal, 0xFFFFFFFF,<br />
path, MAX_PATH);<br />
<br />
if (fileCount>0)<br />
{<br />
g_szSelectedFiles.SetSize(fileCount);<br />
<br />
for (UINT i=0;i<fileCount;i++) <br />
{<br />
memset(path, 0, MAX_PATH);<br />
if (DragQueryFile((HDROP)medium.lpszFileName, i, path, MAX_PATH)) <br />
{<br />
g_szSelectedFiles.SetAt(i, path);<br />
}<br />
}<br />
<br />
g_szSelectedFiles.FreeExtra();<br />
}<br />
<br />
ReleaseStgMedium(&medium);<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
modified on Friday, February 22, 2008 6:44 AM
|
|
|
|
|
My first instinct is to ignore reposts...
But it's a harder question than it sounds.
But when I read your first post, I did a bit of research - and I hate to waste work I already did.
I read through Michael Dunn's shell extension articles (my go to reference for all this stuff). When an extension is initially used, the IShellExiInit interface of your COM object is retrieved, and its Initialize method called.
This gives the PIDL of the directory, and a IDataObject interface to interrogate.
If you call the pDataObject->GetData with the HDROP formatetc parameter, you get the destination of the link.
BUT:
I then called the EnumFormatEtc, and logged the results.
At the bottom is my code, and here are the results:
Clipboard format name: Shell IDList Array
Clipboard format code: 15
Clipboard format name: FileName
Clipboard format name: FileNameW
15 corresponds to CF_HDROP - but there are other formats you can grab the data in.
I think these other formats are worthy of your investigation - especially Shell IDList Array. I've just done a google search, and there are many good soundign hits, even a few from codeproject.
I'd be interested in your results!
Good luck,
Iain.
STDMETHODIMP CSimpleShlExt::Initialize ( LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hProgID )
{
FORMATETC f, fmt = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM stg = { TYMED_HGLOBAL };
HDROP hDrop;
HRESULT hr = S_OK;
TCHAR oBuf [MAX_PATH];
IEnumFORMATETC *pEnum = NULL;
hr = pDataObj->EnumFormatEtc (DATADIR_GET, &pEnum);
if (SUCCEEDED(hr))
{
TCHAR szBuf [1025] = { 0 };
ULONG lFetched = 0;
while (S_OK == pEnum->Next (1, &f, &lFetched))
{
if (GetClipboardFormatName (f.cfFormat, szBuf, 1024))
wsprintf (oBuf, _T("Clipboard format name: %s\n"), szBuf);
else
wsprintf (oBuf, _T("Clipboard format code: %i\n"), f.cfFormat);
OutputDebugString (oBuf);
}
pEnum->Release ();
}
.....
etc
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
I have a 'Table' object (reads a text file to create a table and return table picks). I have moved the code into it's own class library project, and I wish to call the code in the .dll from the main app. The class library project compiles to a .dll, but I don't know how to add it to the main project. I have addded the header file to the main project, and put the .dll in the source directory and debug directories.
How do I add a reference to the .dll? Do I use '#include' or '#using'? How do I declare / instantiate the object, etc. (my attempts broke the build).
What are the basic steps to do this? Can I put both projects in the same solution? Both are in C++ / VS2005. THe main app is from the DirectX SDK April 2007.
Thanks,
Steve
|
|
|
|
|
|
|
I have read the article 'DLLs are simple: Part 2' and have successfully moved the code for my Table class into it's own project / .dll.
The example was for VC++ 6.0, whereas my application is in VS 2005. The main difference was the 'Project > Settings > Link (tab)' -- this doesn't exist in VS2005. To add the .lib file to the project, I put it in the main project directory and right-clicked on the solution and added an existing item, for file type I had to select 'all file types *.*', and added the .lib file to the project. I put the .dll in the debug folder, where the .exe gets put after a build.
What I haven't done yet is to add my .dll project to the main project. I plan to add a new class library to the main application project, and copy and paste the code from the .dll project into it, and hope that it creates a .dll file, a .lib file, and a .exe file. The hope is that I would then be able to take the .dll, .lib, and .h file and use it in other projects.
The purpose of this was to create a fast distance function, which does not call the sqrt function. It takes two or three parameters and returns length of the 'hypotenuse' without using sqrt. With a lookup table of only three points, I get an accuracy of within 1.5%, more than good enough for my level of detail calculations. It will be interesting to see if my function is actually faster or not.
Steve
|
|
|
|
|
TheGeneral69 wrote: The main difference was the 'Project > Settings > Link (tab)' -- this doesn't exist in VS2005. To add the .lib file to the project, I put it in the main project directory and added the .lib file to the project
projectproperty->linker->input->Additional Dependencies = <libname>
projectproperty->linker->General->Additional Library Directories = <path to libfile>
TheGeneral69 wrote: What I haven't done yet is to add my .dll project to the main project.
TheGeneral69 wrote: copy and paste the code from the .dll project into it, and hope that it creates a .dll file, a .lib file, and a .exe file
just add your dll project to your main project solution.
TheGeneral69 wrote: The hope is that I would then be able to take the .dll, .lib, and .h file and use it in other projects.
yes. you can.
|
|
|
|
|