If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

4: error: `CString' was not declared in this scope
4: error: `CString' was not declared in this scope
5: error: initializer expression list treated as compound expression
5: error: expected `,' or `;' before '{' token
In function `int main()':
41: error: `CreateShortCut' cannot be used as a function

Re: Creating Shortcut by IShellLink

Originally Posted by FastCode2010

The errors by Dev C++

------------------------

4: error: `CString' was not declared in this scope
4: error: `CString' was not declared in this scope
5: error: initializer expression list treated as compound expression
5: error: expected `,' or `;' before '{' token
In function `int main()':
41: error: `CreateShortCut' cannot be used as a function

Execution terminated

Well, as I can see the problem is CString only (all further ones are caused by that), and it has nothing to do with shell link. You have to provide an implementation of CString class, or otherwise go with some other string implementation.

Re: Creating Shortcut by IShellLink

in the shortcut target. This exact string above works if I use the GUI and type it into the Target field on the shortcut properties. However, SetPath() adds a leading and trailing quotation mark and changes the forward slash to a backslash.

Is there a way to use the IShellLink interface and specify *exactly* what is used for the target string?