|
Actually I said the wrong thing, sorry. I am trying to get a value from my ini file and it wont find the ini file if its only \ which is why I wanted to convert it to \\
|
|
|
|
|
|
You should not need to do so. That is why I was confused. \\ is only needed if the string is compiled into your program or you are using a UNC server name such as \\mypc\share\file.txt instead of c:\file.txt. The reason why you need an extra slash in a compiled string is that \ is the escape character in c. The character that comes after the \ is gobbled up and converted into a code \n = new line \r = carrage return \t = tab. But how then do I use a \ in a string constant when I really want a \. The language writers added \\ = \ to allow this. When you read your data from any other method other than compiled into these conversions do not occur so you never need \\ in any type of file.
John
|
|
|
|
|
|
Without seeing the code that you are using, I don't fully understand the problem. Actually I'm not sure there is a problem. More likely it's just a misunderstanding of how backslashes in string literals work in C.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
the double slash is just a representation when you edit your code to say that you store the only character slash ('\\' = \) instead of an escape character.
for example, if you make this :
CString strPath = ".\nonoFolder" it will see \n and replace it as a CR-LF.
if you make instead CString strPath = ".\\nonoFolder" , there's no more problem.
i dont know how you get the path however, but if you get it from a "get folder" dialog, even if the user see only one slash, the storing string is correct...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Ok to remove confusion this is what I currently have:
//Get the current working directory
_getcwd( workingDirectory, _MAX_PATH );
printf( "%s\n", workingDirectory );
//Get the value from the ini file
GetPrivateProfileString("Auth", "Key", "", szAuth, sizeof(szAuth), "D:\\Programs\\Microsoft Visual Studio\\MyProjects\\Project12\\Debug\\Settings.ini");
What I want to do is take the working directory and put it into GetPrivateProfileString with \Settings.ini on the end. There is probably a better way than the way I am thinking of doing it so I am open to suggestions on doing it different ways.
|
|
|
|
|
Hello folks.I don't watch movies much but some days ago i brought a computer cd rom cd at home and inserted it in the cd room and a program started straight away which run that movie.I got an idea from there why not to write a program which behaves like that, i.e. it runs without triggering it.Any idea how to do this.
Regards.
Be FaithFull To Your Work.
|
|
|
|
|
|
The article you referred is concerned with autoplaying a movie whereas i asked about launching an application without triggering it and not about the execution of a movie in the context of autoplay.Hope you will help me.
Be FaithFull To Your Work.
|
|
|
|
|
|
This link is again executiong an applicatioin from cd.Suppose that you have written an application ( adding two number i.e,2+1=3 ) in VC 6 and you want that you trigger it without generating an event from user like double clicking it.Hope you understand.Is it possible if yes please help.
Be FaithFull To Your Work.
|
|
|
|
|
I'm not sure what you mean by "you trigger it without
generating an event from user like double clicking it"
When exactly do you want the program to run if there is
no event to trigger it, like loading from CD or double-clicking?
There must be some event to trigger it or otherwise how can the
operating system know when to run it?
Steve T
|
|
|
|
|
One way is to programmatically develop the application in such a way that whenever the computer starts it automatically runs itself.(Starts itself when the computer starts). This is very easy to do by putting a few lines of code in the application it sets it path in registry.But i am talking about the fact is there is OS service or utility which is in access of user so that the user can join his/her application with that utility of service of OS(windows).For example in Linux there is a utility or service from the name figure or finger ( something like that ) which allows us to do so.
Be FaithFull To Your Work.
|
|
|
|
|
Usman Tasleem Akshaf wrote:
But i am talking about the fact is there is OS service or utility which is in access of user so that the user can join his/her application with that utility of service of OS(windows).
Sorry, I have no clue what this means.
Steve T
|
|
|
|
|
it's quite a stupid question...
how to disable creating help files in created project? i selected this property while creating a project and now i'd like to turn it off but i can't find it in project properties (perhaps i'm blind )...
|
|
|
|
|
One way, although maybe not the best, is to open the Project Dependencies dialog. Simply remove the checkbox from the help project.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I recently starting using a 2D Active X Control I found at this site. But does anyone know where I can found a good tutorial of how to set up a graphical control that plots x, y points...or a tutorial that explains how they work. I want to understand the details.
Jerry
|
|
|
|
|
Hello,
I have stumbled upon a (what I think) minor problem, but can not solve it.
(see: problem).
Disabled controls...
I have a dialog in a docking bar (resizeable), in that dialog I have 1 custom made
timeline control (similar to Adobe Premiere and such) and 3 buttons.
All controls, including, the buttons are added through the Dialog editor.
The control works flawlessly, no problem, but all the buttons are inactive..
No matter what I do, they never become active (click able)..
Any idea would be most appreciated..
Thanks
Fredrik Kling
More info:
- SDI application
- Dialogs constructed by allocation, like (from the mainframe):
<br />
ptrDlgDocManager = new CDlgDocManager();<br />
ptrDlgDocManager->SetSizeDockStyle(SZBARF_DLGAUTOSIZE);<br />
if (!ptrDlgDocManager->Create(this,IDD_DIALOG_DOCUMENT,CBRS_BOTTOM | CBRS_FLYBY | CBRS_GRIPPER | CBRS_SIZE_DYNAMIC, ID_VIEW_DOCUMENT))<br />
{<br />
return -1;<br />
}<br />
ptrDlgDocManager->EnableDocking(CBRS_ALIGN_ANY);<br />
DockControlBar(ptrDlgDocManager);<br />
|
|
|
|
|
i don't understand why you say both taht you use MFC but no CDialog...
anyway, if you have the ID of you buttons, why not doing so :
CButton* MyButton = (CButton*)GetDlgItem(IDC_MYBUTTON);
MyButton->EnableWindow(TRUE);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
While its hard to be sure, this is what I think your problem is...
You have created a CDialogBar. During idle moments, MFC tries to synchronise the enable / disable state
of its buttons with the rest of the application. This is the same mechanism that makes your menu items
enabled disabled.
If you look up CDialogBar, you see its inherited from CControlBar. That has a virtual function OnUpdateCmdUI.
If you override that, MFC will no longer enable / disable your controls depending on whether they have
command handlers in other parts of your application.
class CMyDialogBarThatDoesntUpdate : public CDialogBar
{
...
virtual void OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler )
{
}
...
};
That should remove this bar from the update mechanism.
Iain.
|
|
|
|
|
Thank you!
Problem solved...
> If you override that, MFC will no longer enable / disable your controls depending on whether they have
> command handlers in other parts of your application.
Ok, thats why it worked in another application... (The handler was present in the MainForm)
Never thought of why, probably because it had a handler then...
Thanks alot..
// Fredrik
|
|
|
|
|
Hi,
I've got a problem compiling my code on some machines. The code in questions uses
#include <cdosys.h>
On my machine, that's not a problem, it compiles and links without a hitch. On other machines in the office I get the following output from the compiler:
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(523) : error C2061: syntax error : identifier 'RecordCreateOptionsEnum'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(532) : error C2061: syntax error : identifier 'RecordCreateOptionsEnum'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(543) : error C2061: syntax error : identifier 'RecordCreateOptionsEnum'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(845) : error C2061: syntax error : identifier 'RecordCreateOptionsEnum'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(863) : error C2061: syntax error : identifier 'RecordCreateOptionsEnum'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(892) : error C2061: syntax error : identifier 'RecordCreateOptionsEnum'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(1099) : error C2061: syntax error : identifier '_Stream'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(2276) : error C2061: syntax error : identifier '_Stream'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(2371) : error C2061: syntax error : identifier '_Stream'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(2374) : error C2061: syntax error : identifier '_Stream'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(2377) : error C2061: syntax error : identifier '_Stream'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(2844) : error C2061: syntax error : identifier '_Stream'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(2856) : error C2061: syntax error : identifier '_Stream'<br />
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\cdosys.h(2868) : error C2061: syntax error : identifier '_Stream'<br />
c:\develop\proj\myfile.cpp(578) : error C2039: 'Update' : is not a member of '_NoAddRefReleaseOnCComPtr<struct CDO::ADOFields>'
Anyone got any ideas what the problem could be? Both machines have the latest SDK, properly referenced, and the latest service packs installed. Both machines are WinXP pro and the dev environment in MSVC 6.
-Dy
|
|
|
|
|
it is clearly a SDK problem.
it seems that the sdk is not well referenced (even if you believe it is).
now, how to resolve this, i'm struggling.
i don't know at all.
perhaps if you provide more infos... (computers differences)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
As you have the proper files on both machines, I'd suspect the ordering of the include directories.
One PC may look in the platform SDK directory first, and find the header there, and the other PC
might look in the visual studio include directory first, and find the header there...
That problem might not be with cdosys.h, but with a header *it* includes. One version defines _Stream
etc, and the other does not.
In VC6, look at Tools | Options, Directory tab, and pick Include on the Combo box. There are black
arrows to rearrange the order.
Have a look at the working machine, and replicate the order on the not-working machine!
Good luck,
Iain.
|
|
|
|