Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone!

I would like to start by saying thanks to everyone who takes some time to view this thread and try to help.

My problem is quite simple to describe:

I have created an edit control with resource editor ( I use ResEdit, since Visual Studio Express Edition doesn't provide one ), and have tried to paste some text that I have copied from Notepad, but nothing happens.

If I type some text into edit control, then select that text, so it is highlighted, and try to paste, the text disappears and only flashing caret remains.

I have tried with checking the "Accept Files" flag in ResEdit, yet it didn't work either, as I expected...

EDIT #2:
**************************************************************

I have discovered the cause of the problem:
Mozilla Firefox blocks paste operation when running, but after I turn off Firefox everything works fine.
I don't think it is Firefox, but the problem starts when I turn it on.

After working in Firefox for a while, and closing it, the problem remains.

All other programs ( Notepad, Word ... ) work fine, it is just mine that has problems.

By the way, edit control was created in dialog box, yet when I create edit control via CreateWindowEx( .. ), the problem still persists.

Only after I restart my computer, and restart my application, does paste work fine.

IMPORTANT:

This behavior is typical for ALL programs that I write.

That is all important information I have managed to gather, I will post more if I find anything else.

********************************************************************

Here is the snippet from the resource file:

// Generated by ResEdit 1.5.11
// Copyright (C) 2006-2012
// http://www.resedit.net

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"



LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG13 DIALOG 0, 0, 506, 329
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_GROUP | WS_POPUP | WS_SYSMENU
CAPTION "Нови Објекат"
FONT 8, "Microsoft Sans Serif"
{
    EDITTEXT        IDC_EDIT1, 25, 24, 100, 13, ES_AUTOHSCROLL
    LTEXT           "Улица", IDC_STATIC, 25, 15, 30, 8, SS_LEFT
    LTEXT           "Број", IDC_STATIC, 26, 69, 15, 8, SS_LEFT
    EDITTEXT        IDC_EDIT2, 45, 67, 30, 13, ES_AUTOHSCROLL
    COMBOBOX        IDC_COMBO1, 141, 24, 70, 15, CBS_DROPDOWNLIST | CBS_HASSTRINGS
    LTEXT           "Општина", IDC_STATIC, 141, 15, 40, 8, SS_LEFT
    LTEXT           "X", IDC_STATIC, 92, 68, 8, 8, SS_LEFT
    LTEXT           "Y", IDC_STATIC, 151, 68, 8, 8, SS_LEFT
    EDITTEXT        IDC_EDIT3, 100, 66, 35, 13, ES_AUTOHSCROLL
    EDITTEXT        IDC_EDIT4, 160, 66, 35, 13, ES_AUTOHSCROLL
    GROUPBOX        "Координате", IDC_STATIC, 85, 54, 126, 34, BS_CENTER
    GROUPBOX        "ЛОКАЦИЈА", IDC_STATIC, 10, 5, 215, 91, BS_CENTER
    CONTROL         "", IDC_SPIN1, UPDOWN_CLASS, UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP, 135, 65, 11, 15
    CONTROL         "", IDC_SPIN2, UPDOWN_CLASS, UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP, 195, 65, 11, 15
    LTEXT           "Назив ", IDC_STATIC, 20, 114, 35, 8, SS_LEFT
    EDITTEXT        IDC_EDIT5, 20, 123, 100, 13, ES_AUTOHSCROLL
    LTEXT           "Површина", IDC_STATIC, 128, 150, 35, 8, SS_LEFT
    EDITTEXT        IDC_EDIT6, 166, 149, 34, 13, ES_AUTOHSCROLL
    CONTROL         "", IDC_SPIN3, UPDOWN_CLASS, UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP, 200, 148, 11, 14
    LTEXT           "Намена геотермалне енергије", IDC_STATIC, 20, 139, 110, 8, SS_LEFT
    COMBOBOX        IDC_COMBO2, 20, 149, 100, 15, CBS_DROPDOWNLIST | CBS_HASSTRINGS
    LTEXT           "Алтернативна енергија", IDC_STATIC, 20, 165, 92, 8, SS_LEFT
    COMBOBOX        IDC_COMBO3, 20, 175, 100, 12, CBS_DROPDOWNLIST | CBS_HASSTRINGS
    LTEXT           "Енергетски  пасош", IDC_STATIC, 126, 114, 66, 8, SS_LEFT
    COMBOBOX        IDC_COMBO4, 126, 123, 85, 12, CBS_DROPDOWNLIST | CBS_HASSTRINGS
    AUTORADIOBUTTON "Да", IDC_RADIO1, 140, 177, 25, 8, WS_GROUP
    AUTORADIOBUTTON "Не", IDC_RADIO2, 180, 177, 20, 8
    AUTORADIOBUTTON "Домаћинства", IDC_RADIO3, 40, 213, 60, 8, WS_GROUP
    AUTORADIOBUTTON "Индустрија", IDC_RADIO4, 140, 213, 50, 8
    AUTORADIOBUTTON "Пољопривреда", IDC_RADIO5, 40, 228, 70, 8
    AUTORADIOBUTTON "Саобраћај", IDC_RADIO6, 140, 228, 50, 8
    AUTORADIOBUTTON "Јавна и Комунална предузећа", IDC_RADIO7, 40, 243, 125, 8
    GROUPBOX        "КАРАКТЕРИСТИКЕ ОБЈЕКТА", IDC_STATIC, 10, 101, 215, 170, BS_CENTER
    CTEXT           "Тип\nунутрашњих инсталација", IDC_STATIC, 251, 205, 86, 17, SS_CENTER
    COMBOBOX        IDC_COMBO5, 251, 221, 85, 12, CBS_DROPDOWNLIST | CBS_HASSTRINGS
    CTEXT           "Доступна топлотна снага", IDC_STATIC, 356, 205, 55, 15, SS_CENTER
    EDITTEXT        IDC_EDIT8, 356, 221, 44, 12, ES_AUTOHSCROLL
    CTEXT           "Инсталисана топлотна снага", IDC_STATIC, 429, 205, 55, 20, SS_CENTER
    EDITTEXT        IDC_EDIT9, 430, 221, 44, 12, ES_AUTOHSCROLL
    CONTROL         "", IDC_SPIN4, UPDOWN_CLASS, UDS_ARROWKEYS, 400, 221, 11, 13
    CONTROL         "", IDC_SPIN5, UPDOWN_CLASS, UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP, 474, 221, 11, 13
    AUTORADIOBUTTON "Хидрогеотермална", IDC_RADIO8, 262, 27, 81, 8, WS_GROUP
    AUTORADIOBUTTON "Литогеотермална ", IDC_RADIO9, 403, 27, 79, 8
    GROUPBOX        "Тип геотермалне енергије", IDC_STATIC, 250, 16, 235, 25, BS_CENTER
    GROUPBOX        "Тип објекта", IDC_STATIC, 20, 201, 190, 59, BS_CENTER
    PUSHBUTTON      "", IDC_BUTTON7, 461, 288, 25, 20, BS_ICON
    LTEXT           "Тип издани", 3009, 339, 58, 45, 8, NOT WS_VISIBLE | SS_LEFT
    COMBOBOX        IDC_COMBO6, 340, 67, 135, 12, NOT WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS
    LTEXT           "Ознака ресурса", 3002, 392, 250, 56, 8, NOT WS_VISIBLE | SS_LEFT
    COMBOBOX        IDC_COMBO7, 455, 249, 30, 12, NOT WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS
    LTEXT           "Хидрогеотермални систем", 3003, 251, 240, 105, 8, NOT WS_VISIBLE | SS_LEFT
    COMBOBOX        IDC_COMBO8, 250, 158, 105, 12, NOT WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS
    LTEXT           "Диспозиција подземних вода", 3004, 251, 148, 100, 8, NOT WS_VISIBLE | SS_LEFT
    COMBOBOX        IDC_COMBO9, 250, 248, 105, 12, NOT WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS
    COMBOBOX        IDC_COMBO10, 395, 158, 91, 12, NOT WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS
    PUSHBUTTON      "", IDC_BUTTON6, 361, 245, 25, 21, NOT WS_VISIBLE | BS_ICON
    GROUPBOX        "Потрошна топла вода", IDC_STATIC, 125, 165, 85, 26, BS_CENTER
    GROUPBOX        "ПРИМЕНА ГЕОТЕРМАЛНЕ ЕНЕРГИЈЕ", IDC_STATIC, 240, 5, 256, 266, BS_CENTER
    GROUPBOX        "Карактеристике изворишта", 3012, 250, 46, 235, 96, NOT WS_VISIBLE | BS_CENTER
    COMBOBOX        IDC_COMBO11, 261, 67, 70, 12, NOT WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS
    LTEXT           "Тип изворишта", 3005, 262, 58, 70, 8, NOT WS_VISIBLE | SS_LEFT
    CONTROL         "", IDC_LIST2, WC_LISTVIEW, NOT WS_VISIBLE | WS_TABSTOP | WS_BORDER | LVS_ALIGNLEFT | LVS_EDITLABELS | LVS_SINGLESEL | LVS_REPORT, 260, 85, 185, 51
    CONTROL         "", IDC_LIST3, WC_LISTVIEW, NOT WS_VISIBLE | WS_TABSTOP | WS_BORDER | LVS_ALIGNLEFT | LVS_EDITLABELS | LVS_SINGLESEL | LVS_REPORT, 365, 150, 120, 53
    PUSHBUTTON      "+", IDC_BUTTON9, 455, 90, 18, 18, NOT WS_VISIBLE | BS_ICON
    PUSHBUTTON      "-", IDC_BUTTON10, 455, 113, 18, 18, NOT WS_VISIBLE | BS_ICON
    PUSHBUTTON      "+", IDC_BUTTON11, 270, 175, 22, 22, NOT WS_VISIBLE | BS_ICON
    PUSHBUTTON      "-", IDC_BUTTON12, 314, 175, 22, 22, NOT WS_VISIBLE
}


***************************************************************

I work in MS Visual Studio Express 2008, on Windows XP, in C++, using pure WIN32 API.

If any other information is required ( source code or something similar ), please ask for it, I will more than gladly supply it.
Posted
Updated 21-Jun-13 21:13pm
v5
Comments
Richard MacCutchan 21-Jun-13 8:11am    
I use VS2010 Express and just tried this and I can Copy, Cut and Paste from and into my edit control. Can you show us the resource script for your dialog (please use "Improve Question to paste it above)?
MyOldAccount 21-Jun-13 19:44pm    
I have discovered the problem:it is Firefox,when running it blocks my paste function,but when turned off everything is fine.Can you help please?
Jochen Arndt 22-Jun-13 3:38am    
A curious problem. I don't think that it is sourced by your program if it does not perform some kind of clipboard manipulation. You may use a clipboard viewer program to see what is on the clipboard. Such a viewer can be found here at CP: http://www.codeproject.com/Articles/168/ClipSpy

You certainly can copy, cut and paste in all edit controls, and it is true for all similar controls on all more or less modern OS and UI libraries I tried so far.
I think that your problem is just the artifact of wrong way of experimenting/testing. For example, when you complain that you highlight some content and then operate "Paste", having an empty content is quite a correct behavior if your clipboard data currently has empty data of required clipboard data type. This is actually the indication that your paste functionality works, otherwise you would see no changes in content. You don't need to highlight anything to paste content; it would be inserted somewhere, depending on insertion point. You can select part of content, do "Copy", and then "Paste", then you will see the effect. I would advise you to learn using the system as a regular user better, to start with.

—SA
 
Share this answer
 
Comments
MyOldAccount 21-Jun-13 18:25pm    
Maybe you were right, maybe it was wrong clipboard data type.
My 5 anyway, for your suggestion.
MyOldAccount 21-Jun-13 21:17pm    
I apologize for rejecting solution.I have found a cause of my problem:It is Firefox.When it is turned on it blocks any paste function in my program.Can you help me please?
Thank you.
Sergey Alexandrovich Kryukov 21-Jun-13 22:33pm    
No, because I also use Mozilla, and it does not block anything. Such blocking across different processes is almost impossible and would mean the level of abuse which could easily be dubbed computer crime. Sorry, but I cannot believe that your observations are correct. This is also confirmed by your original question where the problem is the incorrectness of your observation.
—SA
MyOldAccount 22-Jun-13 0:42am    
Still, when I use my program, paste works fine, yet when I turn on Firefox, I can't paste.
After I turn it off, my program works fine again.
I have never said that it is Firefox to blame, I just added this info to help people to help me with this.
Still, I will understand if you can not solve this.
Thanks anyway.
Sergey Alexandrovich Kryukov 22-Jun-13 1:30am    
Hm...
After battling this for more than a month, I have decided to take my friends Windows XP, and do a full clean installation.

After that, the problem seems to have disappeared...

Hopefully it will stay that way :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900