|
Simple way: They are just plain text files. Use general file operations.
Complete way: Office Automation. You can find a sample in the MSDN.
|
|
|
|
|
In a particular VC++ 2005 MFC dialog, the "Question Mark button" (near Close button) shows up even after I set "Context Help" property to False.
In other dialogs the button shows up or disappears properly after setting or resetting that property.
Can somebody tell me whats wrong? or What else controls the display of that button?
Thanks.
|
|
|
|
|
Is there any way to disable "My Computer", so the user can't select "My Computer"?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Does that mean you want the user to only be able to select file-system folders? If so, you want to set the BIF_RETURNONLYFSDIRS flag in ulFlags in the BROWSEINFO you're passing SHBrowseForFolder .
|
|
|
|
|
I already have that flag but it seems to have no effect, My Computer can still be selected
here's my code:
BROWSEINFO bi;
LPITEMIDLIST pidl;
LPMALLOC pMalloc;
if (SUCCEEDED(SHGetMalloc(&pMalloc)))
{
ZeroMemory(&bi,sizeof(bi));
bi.hwndOwner = hwndOwner;
bi.pszDisplayName = 0;
bi.pidlRoot = 0;
bi.lpszTitle = title;
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_VALIDATE | BIF_NEWDIALOGSTYLE;
bi.lpfn = BrowseCallbackProcStatic;
bi.lParam = reinterpret_cast<LPARAM> (this);
pidl = SHBrowseForFolder(&bi);
if (pidl)
{
char sz[MAX_PATH];
SHGetPathFromIDList(pidl, sz);
m_Folder = sz;
}
pMalloc->Free(pidl);
pMalloc->Release();
}
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: I already have that flag but it seems to have no effect, My Computer can still be selected
But you should find that the user can't press 'OK' when they have 'My Computer' selected, so the return value from SHBrowseForFolder cannot be 'My COmputer'?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
It seems this doesn't happen if BIF_NEWDIALOGSTYLE flag is raised. See this screenshot.[^]
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
You're quite right - all I can suggest is using the lpfn member of BROWSEINFO[^] to implement a callback[^] that only enables the OK button when you have a file-system item selected, or maybe implementing the custom filtering feature documented in the SHBrowseForFolder documentation[^].
Either that or disable the 'new UI'!
Looking at this newsgroup thread[^], this has been known about for over 6 years (I'm drawing an analogy between a \\server and 'My Computer' - seems reasonable).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for the link, at the end they explained how to make it work. Here's the code (following their advice):
if (uMsg == BFFM_SELCHANGED)
{
LPITEMIDLIST pidl = reinterpret_cast<LPITEMIDLIST> (lParam);
char UnusedBuffer[MAX_PATH];
BOOL ShouldEnableOkButton = SHGetPathFromIDList(pidl, UnusedBuffer);
::SendMessage(hwnd, BFFM_ENABLEOK, 0, ShouldEnableOkButton);
}
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi,
In my application, i want to get one scrolling window by clicking in the view (CGraphView) class.
So i used this following code.From this i can get the window .But i cannot scroll the window,if i scrollign nothing will happen.
Pls help me.
Code:-
HINSTANCE hInst = AfxGetInstanceHandle();
HWND GlgControl;
GlgObject drawing;
drawing = GlgLoadWidgetFromFile(pFileName);
GlgSetDefaultViewport(drawing);
GlgControl = CreateWindow("GlgControl",sPopName,WS_VISIBLE|WS_SYSMENU|WS_VSCROLL|WS_HSCROLL ,xval+5,yval+5,CW_USEDEFAULT,CW_USEDEFAULT,(HWND)(((CGraphView *)(((CMainFrame *)AfxGetMainWnd())->pDisplayedViews[6]))->glg_animation[giSchPNo].m_hWnd),NULL,hInst,NULL);
GlgInitialDraw(drawing);
Anu
|
|
|
|
|
You have to manage the scroll yourself: you have to override the OnHScroll and OnVScroll members from CWnd and take the appropriate actions there. For instance store the new initial horizontal and vertical positions of your view and request a refresh of your window. In your drawing code, you then take those information in consideration to redraw properly your window.
|
|
|
|
|
MFC, STUDIO 2008, MDI-project
void CPage1::OnBnClickedButton1()
{
CRect rect(85, 110, 180, 210);
CEdit m_edit; // Embedded edit object
m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
ES_AUTOHSCROLL | WS_BORDER, rect, this,
ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier
m_edit.SetFocus();
}
|
|
|
|
|
1/ What's your question
2/ Include resource.h? Your compiler is saying "ID_EXTRA_EDIT? Never heard of it"
3/ Check your spelling.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Yes, and ? Just define ID_EXTRA_EDIT in your resource.h file.
|
|
|
|
|
First I am a Chinese boy. My English is not very good.
change
m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
ES_AUTOHSCROLL | WS_BORDER, rect, this,
ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier
for
m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
ES_AUTOHSCROLL | WS_BORDER, rect, this,
1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier
the meaning is Specifies the edit control’s ID.(msdn)
then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost.
sorry,my English is so poor...
|
|
|
|
|
blueapplezh wrote: then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost.
Yes, that's correct, I didn't see that at all.
blueapplezh wrote: change
m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
ES_AUTOHSCROLL | WS_BORDER, rect, this,
ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier
for
m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
ES_AUTOHSCROLL | WS_BORDER, rect, this,
1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier
the meaning is Specifies the edit control’s ID.(msdn)
I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice.
|
|
|
|
|
I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice.
You are clever,I have advise that,but my English is too poor to express my opinion.
If I am a USA boy ,HOHO~~~~~
|
|
|
|
|
blueapplezh wrote: You are clever,I have advise that,but my English is too poor to express my opinion.
I would advise you to use the 'Quote Selected Text ' button to report the words of the post you're replying to.
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
[My articles]
|
|
|
|
|
CPallini wrote: I would advise you to use the 'Quote Selected Text' button to report the words of the post you're replying to. Roll eyes
Smile
Thanks very mu ch!!!
|
|
|
|
|
#define ID_EXTRA_EDIT 3000 is your answer and also I saw one more thing in your code you must declare CEdit m_edit out of this function.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
i m using soap library for C++ client and hv searched alot almost all code are using same way but Its Giving exception on
Connector->EndMessage();
my Wcf service has One Method "GetMessage(string name)
URL is (Hellow is virtual directory for IIS)
<a href=""><a href="http://localhost/Hellow/HelloWorldService.svc">http://localhost/Hellow/HelloWorldService.svc</a>
and client code is
<pre>
#include <stdio.h>
#import "msxml3.dll"
using namespace MSXML2;
#import "C:\Program Files\Common Files\MSSoap\Binaries\MSSOAP1.dll" \
exclude("IStream", "ISequentialStream", "_LARGE_INTEGER", \
"_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME")
using namespace MSSOAPLib;
void CallService()
{
ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
ISoapConnectorPtr Connector;
// Connect to the service
Connector.CreateInstance(__uuidof(HttpConnector));
Connector->Property["EndPointURL"] = "http://localhost/Hellow/HelloWorldService.svc";
Connector->Connect();
// Begin message
Connector->Property["SoapAction"] = "uri:http://localhost/Hellow/HelloWorldService/GetMessage";
Connector->Property["UseSSL"] = "True";
Connector->BeginMessage();
// Create the SoapSerializer
Serializer.CreateInstance(__uuidof(SoapSerializer));
// Connect the serializer to the input stream of the connector
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));
// Build the SOAP Message
Serializer->startEnvelope("","","");
Serializer->startBody("");
Serializer->startElement("GetMessage","uri:http://localhost/Hellow/HelloWorldService/GetMessage","","m");
Serializer->startElement("name","","","");
Serializer->writeString("shaina");
Serializer->endElement();
Serializer->endElement();
Serializer->endBody();
Serializer->endEnvelope();
// Send the message to the web service
Connector->EndMessage();
// Let us read the response
Reader.CreateInstance(__uuidof(SoapReader));
// Connect the reader to the output stream of the connector
Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), "");
// Display the result
printf("Answer: %s\n", (const char *)Reader->RPCResult->text);
}
void main()
{
CoInitialize(NULL);
CallService();
CoUninitialize();
}
</pre>
Any suggestions wil be appreicated.
PLZzzzzzzzz help
|
|
|
|
|
Hai!
I am doing my application in embedded VC++.
I have included the file WINSCARD.h, and add the library WINSCARD.lib in the Project Settings>>Link>> Category(INPUT)>> in library modules.
But when i use the function SCardEstablishContext () or SCardListReaders () i get the following error :
error LNK2019: unresolved external symbol _SCardEstablishContext referenced in function "public: void __thiscall CListRdrsDlg::OnDropdownComboRdrs(void)" (?OnDropdownComboRdrs@CListRdrsDlg@@QAEXXZ)
how to get rid of this?
Thanks!
|
|
|
|
|
kapardhi wrote: add the library WINSCARD.lib in the Project Settings>>Link>> Category(INPUT)>> in library modules.
In both Debug and Release modes?
Also - does the linker know what directory it'll find the library in?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I also inculded the path where the WINSCARD.lib is present and selected "All Configurations" option that includes ARM4 Debug, Arm4 Relese, Emulator Debug and emulator release.
still the problem persists !
|
|
|
|
|
The only thing I can think of is this: are you using the correct version of the library ? By this I mean that you cannot use the win32 version of the library, because you are developping for winCE. I don't know this library so I can't tell you if it exists for winCE or not.
|
|
|
|